|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectThread
Kernel.Launcher
A Launcher instance represents one atomic command being run by the Kernel. It has associated with it a process id (pid), a Java method to run, and a list of arguments to the method. Do not modify any part of this class.
Field Summary | |
private Object[] |
arglist
The list of arguments to this command. |
private Method |
method
The method being run by this command. |
private static int |
nextpid
Source of unique ids for Launcher instances. |
private Integer |
pid
The process id of this command. |
(package private) static Map |
pidMap
Mapping of process ids (encoded as Integers) to Launcher instances. |
private int |
returnCode
Return code returned by this command (0 if the command has not yet completed. |
Fields inherited from class Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Kernel.Launcher(String command,
String[] args)
Creates a new Launcher for a program. |
Method Summary | |
void |
delete()
Removes this Launcher from the set of all active Launchers. |
static void |
joinAll()
Waits for all existing Launchers to complete. |
static int |
joinOne(int pid)
Waits for a particular Launcher to complete. |
void |
run()
Main loop of the Launcher |
Methods inherited from class Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static Map pidMap
private static int nextpid
private Method method
private Object[] arglist
private Integer pid
private int returnCode
Constructor Detail |
public Kernel.Launcher(String command, String[] args) throws ClassNotFoundException, NoSuchMethodException
command
- the name of the program (new name of a class with
a main(String[]) method.args
- command-line arguments to the program.Method Detail |
public void run()
public static void joinAll()
public static int joinOne(int pid)
pid
- the process id of the desired process.
public void delete()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |