Build 1.0_r1(from source)

java.lang
Class ProcessManager

java.lang.Object
  extended by java.lang.ProcessManager

final class ProcessManager
extends Object

Manages child processes.

Harmony's native implementation (for comparison purposes): http://tinyurl.com/3ytwuq


Nested Class Summary
(package private) static class ProcessManager.ProcessImpl
           
(package private) static class ProcessManager.ProcessReference
           
(package private) static class ProcessManager.ProcessReferenceQueue
           
 
Field Summary
(package private) static ProcessManager instance
           
 
Method Summary
(package private)  void cleanUp()
          Cleans up after garbage collected processes.
(package private)  Process exec(String[] commands, String[] environment, File workingDirectory)
          Executes a process and returns an object representing it.
(package private) static int exec(String[] commands, String[] environment, String workingDirectory, FileDescriptor in, FileDescriptor out, FileDescriptor err)
          Executes a native process.
(package private) static ProcessManager getInstance()
          Gets the process manager.
(package private)  void onExit(int pid, int exitValue)
          Called by watchChildren() when a child process exits.
(package private) static void staticInitialize()
          Initializes native static state.
(package private)  void watchChildren()
          Listens for signals from processes and calls back to onExit(int,int).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

static final ProcessManager instance
Method Detail

staticInitialize

static void staticInitialize()
Initializes native static state.


cleanUp

void cleanUp()
Cleans up after garbage collected processes. Requires the lock on the map.


watchChildren

void watchChildren()
Listens for signals from processes and calls back to onExit(int,int).


onExit

void onExit(int pid,
            int exitValue)
Called by watchChildren() when a child process exits.

Parameters:
pid - ID of process that exited
exitValue - value the process returned upon exit

exec

static int exec(String[] commands,
                String[] environment,
                String workingDirectory,
                FileDescriptor in,
                FileDescriptor out,
                FileDescriptor err)
         throws IOException
Executes a native process. Fills in in, out, and err and returns the new process ID upon success.

Throws:
IOException

exec

Process exec(String[] commands,
             String[] environment,
             File workingDirectory)
       throws IOException
Executes a process and returns an object representing it.

Throws:
IOException

getInstance

static ProcessManager getInstance()
Gets the process manager.


Build 1.0_r1(from source)

Please submit a feedback, bug or feature