Added test on processes
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user