Added test on processes

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
2017-08-19 23:19:41 -04:00
parent 0feb069878
commit b3224ad689
4 changed files with 189 additions and 8 deletions

View File

@@ -40,13 +40,9 @@ package fr.bigeon.gclc;
import fr.bigeon.gclc.exception.InvalidCommandName;
/**
* <p>
* TODO
/** Represent a functionnality set that can be added to a console application.
*
* @author Emmanuel Bigeon
*
*/
* @author Emmanuel Bigeon */
public interface ApplicationAttachement {
/** Attach this object to a console application.
* <p>

View File

@@ -56,8 +56,12 @@ public class TaskPool {
/** Add a process in the pool
*
* @param cmd the process */
public void add(final Task cmd) {
* @param cmd the process
* @return the pid */
public String add(final Task cmd) {
if (cmd == null) {
throw new NullPointerException("Task cannot be null"); //$NON-NLS-1$
}
final String pid = getPID();
synchronized (lock) {
running.put(pid, cmd);
@@ -74,6 +78,7 @@ public class TaskPool {
cmd.rmInterruptionListener(this);
}
});
return pid;
}
/** @return the process id */