|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.carol.util.bootstrap.ProcessesManager
Class 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 |
ProcessesManager.ProcessStopThread
Process Shudown process Thread For cleanong the Process's Hashtable |
Field Summary | |
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 |
static java.util.Hashtable |
commands
Object configuration with id |
static java.util.Hashtable |
directories
Object configuration with id |
static java.lang.String |
JAVA_CMD
Java command line |
static java.util.Hashtable |
processes
Processes Hashtable with id |
static int |
START_WAIT_TIME
wait time for processe starting before getting error stream |
Constructor Summary | |
ProcessesManager()
empty constructor |
|
ProcessesManager(boolean cleanb,
boolean vb)
constructor with 2 param: |
Method Summary | |
java.util.Hashtable |
getAllProcess()
Get the all Process id with there command line |
java.lang.String |
getProcessCommand(java.lang.String id)
Get the Process command line |
java.lang.String |
getProcessDirectory(java.lang.String id)
Get the Process directory |
protected java.lang.String |
getProcessError(java.lang.Process p)
get Process error |
int |
getProcessExitValue(java.lang.String id)
Test if a Process is not alive the exit value |
protected java.lang.String |
getProcessOutput(java.lang.Process p)
get Process output |
void |
killAllProcesses()
Kill all processes and remove all process id and configuration |
void |
killProcess(java.lang.String id)
Kill a process (if existe) and remove it's process id and configuration |
boolean |
pingProcess(java.lang.String id)
Test if a Process is always alive |
java.lang.String |
readProcessError(java.lang.String id)
get the rjvm ErrorStream |
java.lang.String |
readProcessOutput(java.lang.String id)
get the rproc OutputStream |
void |
sendFile(java.lang.String dirName,
java.lang.String fileName,
byte[] b)
Send a file to a directory (FileImputStream/FileOutputStream format) this method build a directory in the current directory if the directory does not exite. |
java.lang.String |
startJVM(JVMConfiguration jvmConf,
java.lang.String[] envp)
Start a jvm process on the remote host in a tmp directory |
java.lang.String |
startJVM(JVMConfiguration jvmConf,
java.lang.String[] envp,
java.lang.String processDir)
Start a jvm process on the remote host |
void |
startJVM(JVMConfiguration jvmConf,
java.lang.String[] envp,
java.lang.String processDir,
java.lang.String id)
Start a jvm process on the remote host |
java.lang.String |
startProcess(java.lang.String processLine,
java.lang.String[] envp)
Start a process on the remote host in a tmp directory |
java.lang.String |
startProcess(java.lang.String processLine,
java.lang.String[] envp,
java.lang.String processDir)
Start a process on the remote host |
void |
startProcess(java.lang.String processLine,
java.lang.String[] envp,
java.lang.String processDir,
java.lang.String id)
Start a process on the remote host |
void |
stop()
Stop the damemon and kill all the process |
void |
writeProcessInput(java.lang.String id,
java.lang.String s)
send a String to the rjvm inputStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean CLEAN_PROCESSES
public static final int START_WAIT_TIME
public static java.lang.String JAVA_CMD
public static java.util.Hashtable processes
public static java.util.Hashtable commands
public static java.util.Hashtable directories
Constructor Detail |
public ProcessesManager() throws java.rmi.RemoteException
public ProcessesManager(boolean cleanb, boolean vb) throws java.rmi.RemoteException
Method Detail |
protected java.lang.String getProcessOutput(java.lang.Process p)
p
- process
protected java.lang.String getProcessError(java.lang.Process p)
p
- process
public java.lang.String startJVM(JVMConfiguration jvmConf, java.lang.String[] envp) throws ProcessException, java.rmi.RemoteException
startJVM
in interface RemoteProcessesManager
ProcessException
- if an exception occurs at bootstrapting
java.rmi.RemoteException
public java.lang.String startJVM(JVMConfiguration jvmConf, java.lang.String[] envp, java.lang.String processDir) throws ProcessException, java.rmi.RemoteException
startJVM
in interface RemoteProcessesManager
ProcessException
- if an exception occurs at bootstrapting
java.rmi.RemoteException
public void startJVM(JVMConfiguration jvmConf, java.lang.String[] envp, java.lang.String processDir, java.lang.String id) throws ProcessException, java.rmi.RemoteException
startJVM
in interface RemoteProcessesManager
RProcessException
- if an exception occurs at bootstrapting
ProcessException
java.rmi.RemoteException
public java.lang.String startProcess(java.lang.String processLine, java.lang.String[] envp) throws ProcessException, java.rmi.RemoteException
startProcess
in interface RemoteProcessesManager
ProcessException
- if an exception occurs at bootstrapting
java.rmi.RemoteException
public java.lang.String startProcess(java.lang.String processLine, java.lang.String[] envp, java.lang.String processDir) throws ProcessException, java.rmi.RemoteException
startProcess
in interface RemoteProcessesManager
ProcessException
- if an exception occurs at bootstrapting
java.rmi.RemoteException
public void startProcess(java.lang.String processLine, java.lang.String[] envp, java.lang.String processDir, java.lang.String id) throws ProcessException, java.rmi.RemoteException
startProcess
in interface RemoteProcessesManager
RProcessException
- if an exception occurs at bootstrapting
ProcessException
java.rmi.RemoteException
public void killProcess(java.lang.String id) throws ProcessException, java.rmi.RemoteException
killProcess
in interface RemoteProcessesManager
id
- the Process id
ProcessException
- if the id doesn't existe
java.rmi.RemoteException
public void killAllProcesses() throws java.rmi.RemoteException
killAllProcesses
in interface RemoteProcessesManager
java.rmi.RemoteException
public boolean pingProcess(java.lang.String id) throws ProcessException, java.rmi.RemoteException
pingProcess
in interface RemoteProcessesManager
id
- the Process String id
ProcessException
java.rmi.RemoteException
public int getProcessExitValue(java.lang.String id) throws ProcessException, java.rmi.RemoteException
getProcessExitValue
in interface RemoteProcessesManager
id
- the jvm id
ProcessException
- if - the id doen'st existe (with the
CLEAN_Process_PROCESSES=true for example) - teh jvm with this id
is not yet terminated
java.rmi.RemoteException
public java.lang.String getProcessCommand(java.lang.String id) throws ProcessException, java.rmi.RemoteException
getProcessCommand
in interface RemoteProcessesManager
ProcessException
- if: - The Process id doesn't exist - The Process
process is stop
java.rmi.RemoteException
public java.lang.String getProcessDirectory(java.lang.String id) throws ProcessException, java.rmi.RemoteException
getProcessDirectory
in interface RemoteProcessesManager
ProcessException
- if: - The Process id doesn't exist - The Process
process is stop
java.rmi.RemoteException
public java.util.Hashtable getAllProcess() throws java.rmi.RemoteException
getAllProcess
in interface RemoteProcessesManager
java.rmi.RemoteException
public java.lang.String readProcessOutput(java.lang.String id) throws ProcessException, java.rmi.RemoteException
readProcessOutput
in interface RemoteProcessesManager
id
- the proc id
ProcessException
- if - the id doen'st existe
java.rmi.RemoteException
public java.lang.String readProcessError(java.lang.String id) throws ProcessException, java.rmi.RemoteException
readProcessError
in interface RemoteProcessesManager
id
- the jvm id
ProcessException
- if - the id doen'st existe
java.rmi.RemoteException
public void writeProcessInput(java.lang.String id, java.lang.String s) throws ProcessException, java.rmi.RemoteException
writeProcessInput
in interface RemoteProcessesManager
s
- String to send to the InputStreamid
- the jvm id
ProcessException
- if - the id doen'st existe
java.rmi.RemoteException
public void sendFile(java.lang.String dirName, java.lang.String fileName, byte[] b) throws java.rmi.RemoteException
sendFile
in interface RemoteProcessesManager
java.rmi.RemoteException
public void stop() throws java.rmi.RemoteException
stop
in interface RemoteProcessesManager
java.rmi.RemoteException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |