diff --git a/gclc-process/src/main/java/net/bigeon/gclc/process/CommandForeground.java b/gclc-process/src/main/java/net/bigeon/gclc/process/CommandForeground.java index 8a423fd..fc21b65 100644 --- a/gclc-process/src/main/java/net/bigeon/gclc/process/CommandForeground.java +++ b/gclc-process/src/main/java/net/bigeon/gclc/process/CommandForeground.java @@ -69,6 +69,8 @@ package net.bigeon.gclc.process; * #L% */ import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import net.bigeon.gclc.command.CommandParameters; import net.bigeon.gclc.command.ParametrizedCommand; @@ -92,28 +94,30 @@ import net.bigeon.gclc.manager.ConsoleOutput; * @author Emmanuel Bigeon */ public class CommandForeground extends ParametrizedCommand { - private final TaskPool pool; + /** The class logger. */ + private static final Logger LOGGER = Logger + .getLogger(CommandForeground.class.getName()); + /** The task pool to fetch task from. */ + private final TaskPool pool; /** Add the fork command. * * @param name the command name * @param pool The pool to get joinable tasks from */ - public CommandForeground(final String name, TaskPool pool) { + public CommandForeground(final String name, final TaskPool pool) { super(name, false); this.pool = pool; addParameters(); } - /** - * - */ + /** Add the parameters of the command. */ private void addParameters() { try { addStringParameter("pid", false); addStringParameter("delai", false); } catch (final InvalidParameterException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + // Cannot be reached unless GCLC base framework has an error + LOGGER.log(Level.SEVERE, "unexpected parameter error!", e); } } diff --git a/gclc-process/src/main/java/net/bigeon/gclc/process/InterruptionListener.java b/gclc-process/src/main/java/net/bigeon/gclc/process/InterruptionListener.java index f28674a..b5bd609 100644 --- a/gclc-process/src/main/java/net/bigeon/gclc/process/InterruptionListener.java +++ b/gclc-process/src/main/java/net/bigeon/gclc/process/InterruptionListener.java @@ -68,7 +68,7 @@ package net.bigeon.gclc.process; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -/** A listener for interruption +/** A listener for interruption. * * @author Emmanuel Bigeon */ public interface InterruptionListener { diff --git a/gclc-process/src/main/java/net/bigeon/gclc/process/io/package-info.java b/gclc-process/src/main/java/net/bigeon/gclc/process/io/package-info.java new file mode 100644 index 0000000..4fd9efb --- /dev/null +++ b/gclc-process/src/main/java/net/bigeon/gclc/process/io/package-info.java @@ -0,0 +1,8 @@ +/** Connecting Input and Output related classes. + *

+ * This package groups the Connecting classes that are used to be able to put + * the tasks in background and foreground and reattach the actual console input + * and outputs to the tasks' ones. + * + * @author Emmanuel Bigeon */ +package net.bigeon.gclc.process.io; diff --git a/gclc-process/src/main/java/net/bigeon/gclc/process/package-info.java b/gclc-process/src/main/java/net/bigeon/gclc/process/package-info.java new file mode 100644 index 0000000..0afa2ad --- /dev/null +++ b/gclc-process/src/main/java/net/bigeon/gclc/process/package-info.java @@ -0,0 +1,14 @@ +/** This package defines elements for processes inside a console application. + *

+ * Processes are tasks that are run in background of the application. One may + * want to temporarily connect to such a task (through + * {@link net.bigeon.gclc.process.CommandForeground}), or verify it's actual + * running status (through {@link net.bigeon.gclc.process.ProcessList}. One may + * also want to start such a process (through + * {@link net.bigeon.gclc.process.ForkCommandTask}) or close it (through + * {@link net.bigeon.gclc.process.ProcessKill}). + *

+ * The task list can be managed by several commands to list or clear it. + * + * @author Emmanuel Bigeon */ +package net.bigeon.gclc.process;