Class Kernel.Launcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--Kernel.Launcher
All Implemented Interfaces:
Runnable
Enclosing class:
Kernel

private static class Kernel.Launcher
extends Thread


Field Summary
private  Object[] arglist
           
private  Method method
           
private static int nextpid
           
private  Integer pid
           
(package private) static Hashtable pidMap
           
private  int returnCode
           
 
Fields inherited from class java.lang.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 java.lang.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pidMap

static Hashtable pidMap

nextpid

private static int nextpid

method

private Method method

arglist

private Object[] arglist

pid

private Integer pid

returnCode

private int returnCode
Constructor Detail

Kernel.Launcher

public Kernel.Launcher(String command,
                       String[] args)
                throws Exception
Creates a new Launcher for a program.

Parameters:
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

run

public void run()
Main loop of the Launcher

Specified by:
run in interface Runnable
Overrides:
run in class Thread

joinAll

public static void joinAll()
Waits for all existing Launchers to complete.


joinOne

public static int joinOne(int pid)
Waits for a particular Launcher to complete.

Parameters:
pid - the process id of the desired process.

delete

public void delete()
Removes this Launcher from the set of all active Launchers.