Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.objectweb.carol.util.bootstrap.ProcessesManager
ProcessesManager
Provide a Process Manager for
boostraping Process and send file to a process directory Thie class extends a
remote interface for RMI calls
Nested Class Summary | |
class |
|
Field Summary | |
static boolean |
|
static String |
|
static int |
|
static Hashtable |
|
static Hashtable |
|
static Hashtable |
|
Constructor Summary | |
| |
|
Method Summary | |
Hashtable |
|
String |
|
String |
|
protected String |
|
int |
|
protected String |
|
void |
|
void |
|
boolean |
|
String |
|
String |
|
void |
|
String |
|
String |
|
void |
|
String |
|
String |
|
void |
|
void |
|
void |
|
public static boolean CLEAN_PROCESSES
clean processes/configuration hashtable at shudow (default TRUE) commands.clear(); directories.clear(); Be carful, TRUE for this variable mean one more shudow THREAD in the daemon
public static String JAVA_CMD
Java command line
public static final int START_WAIT_TIME
wait time for processe starting before getting error stream
- Field Value:
- 1000
public static Hashtable commands
Object configuration with id
public static Hashtable directories
Object configuration with id
public static Hashtable processes
Processes Hashtable with id
public ProcessesManager() throws RemoteException
empty constructor
public ProcessesManager(boolean cleanb, boolean vb) throws RemoteException
constructor with 2 param:
- Parameters:
public Hashtable getAllProcess() throws RemoteException
Get the all Process id with there command line
- Specified by:
- getAllProcess in interface RemoteProcessesManager
- Returns:
- Hashtable the process id and his command line
public String getProcessCommand(String id) throws ProcessException, RemoteException
Get the Process command line
- Specified by:
- getProcessCommand in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process command line
- Throws:
ProcessException
- if: - The Process id doesn't exist - The Process process is stop
public String getProcessDirectory(String id) throws ProcessException, RemoteException
Get the Process directory
- Specified by:
- getProcessDirectory in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process directory
- Throws:
ProcessException
- if: - The Process id doesn't exist - The Process process is stop
protected String getProcessError(Process p)
get Process error
- Parameters:
p
- process
- Returns:
- String process error or null if p is not available
public int getProcessExitValue(String id) throws ProcessException, RemoteException
Test if a Process is not alive the exit value
- Specified by:
- getProcessExitValue in interface RemoteProcessesManager
- Parameters:
id
- the jvm id
- Returns:
- int the Process is always alive
- Throws:
ProcessException
- if - the id doen'st existe (with the CLEAN_Process_PROCESSES=true for example) - teh jvm with this id is not yet terminated
protected String getProcessOutput(Process p)
get Process output
- Parameters:
p
- process
- Returns:
- String process output or null if p is not available
public void killAllProcesses() throws RemoteException
Kill all processes and remove all process id and configuration
- Specified by:
- killAllProcesses in interface RemoteProcessesManager
public void killProcess(String id) throws ProcessException, RemoteException
Kill a process (if existe) and remove it's process id and configuration
- Specified by:
- killProcess in interface RemoteProcessesManager
- Parameters:
id
- the Process id
- Throws:
ProcessException
- if the id doesn't existe
public boolean pingProcess(String id) throws ProcessException, RemoteException
Test if a Process is always alive
- Specified by:
- pingProcess in interface RemoteProcessesManager
- Parameters:
id
- the Process String id
- Returns:
- true if the Process is always alive and false if this Process doens't existe anymore or if the process of this Process is stopped
public String readProcessError(String id) throws ProcessException, RemoteException
get the rjvm ErrorStream
- Specified by:
- readProcessError in interface RemoteProcessesManager
- Parameters:
id
- the jvm id
- Throws:
ProcessException
- if - the id doen'st existe
public String readProcessOutput(String id) throws ProcessException, RemoteException
get the rproc OutputStream
- Specified by:
- readProcessOutput in interface RemoteProcessesManager
- Parameters:
id
- the proc id
- Throws:
ProcessException
- if - the id doen'st existe
public void sendFile(String dirName, String fileName, byte[] b) throws RemoteException
Send a file to a directory (FileImputStream/FileOutputStream format) this method build a directory in the current directory if the directory does not exite. Your are not allow to write some thing outside of the current directory
- Specified by:
- sendFile in interface RemoteProcessesManager
- Parameters:
public String startJVM(JVMConfiguration jvmConf, String[] envp) throws ProcessException, RemoteException
Start a jvm process on the remote host in a tmp directory
- Specified by:
- startJVM in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process id
- Throws:
ProcessException
- if an exception occurs at bootstrapting
public String startJVM(JVMConfiguration jvmConf, String[] envp, String processDir) throws ProcessException, RemoteException
Start a jvm process on the remote host
- Specified by:
- startJVM in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process id
- Throws:
ProcessException
- if an exception occurs at bootstrapting
public void startJVM(JVMConfiguration jvmConf, String[] envp, String processDir, String id) throws ProcessException, RemoteException
Start a jvm process on the remote host
- Specified by:
- startJVM in interface RemoteProcessesManager
- Parameters:
public String startProcess(String processLine, String[] envp) throws ProcessException, RemoteException
Start a process on the remote host in a tmp directory
- Specified by:
- startProcess in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process id
- Throws:
ProcessException
- if an exception occurs at bootstrapting
public String startProcess(String processLine, String[] envp, String processDir) throws ProcessException, RemoteException
Start a process on the remote host
- Specified by:
- startProcess in interface RemoteProcessesManager
- Parameters:
- Returns:
- String the process id
- Throws:
ProcessException
- if an exception occurs at bootstrapting
public void startProcess(String processLine, String[] envp, String processDir, String id) throws ProcessException, RemoteException
Start a process on the remote host
- Specified by:
- startProcess in interface RemoteProcessesManager
- Parameters:
public void stop() throws RemoteException
Stop the damemon and kill all the process
- Specified by:
- stop in interface RemoteProcessesManager
public void writeProcessInput(String id, String s) throws ProcessException, RemoteException
send a String to the rjvm inputStream
- Specified by:
- writeProcessInput in interface RemoteProcessesManager
- Parameters:
id
- the jvm ids
- String to send to the InputStream
- Throws:
ProcessException
- if - the id doen'st existe