org.objectweb.carol.util.bootstrap

Interface RemoteProcessesManager

All Superinterfaces:
Remote
Known Implementing Classes:
ProcessesManager

public interface RemoteProcessesManager
extends Remote

Interface RemoteProcessesManager Provide a Process Manager for boostraping Process and send file to a process directory Thie class extends a remote interface for RMI calls

Version:
1.0, 15/11/2002

Author:
Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)

Method Summary

Hashtable
getAllProcess()
Get the all Process id with there command line
String
getProcessCommand(String id)
Get the Process command line
String
getProcessDirectory(String id)
Get the Process directory
int
getProcessExitValue(String id)
Test if a Process is not alive the exit value
void
killAllProcesses()
Kill all processes and remove all process id and configuration
void
killProcess(String id)
Kill a process (if existe) and remove it's process id and configuration
boolean
pingProcess(String id)
Test if a Process is always alive
String
readProcessError(String id)
get the rjvm ErrorStream
String
readProcessOutput(String id)
get the rproc OutputStream
void
sendFile(String dirName, 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.
String
startJVM(JVMConfiguration jvmConf, String[] envp)
Start a jvm process on the remote host in a tmp directory
String
startJVM(JVMConfiguration jvmConf, String[] envp, String processDir)
Start a jvm process on the remote host
void
startJVM(JVMConfiguration jvmConf, String[] envp, String processDir, String id)
Start a jvm process on the remote host
String
startProcess(String processLine, String[] envp)
Start a process on the remote host in a tmp directory
String
startProcess(String processLine, String[] envp, String processDir)
Start a process on the remote host
void
startProcess(String processLine, String[] envp, String processDir, String id)
Start a process on the remote host
void
stop()
Stop the damemon and kill all the process
void
writeProcessInput(String id, String s)
send a String to the rjvm inputStream

Method Details

getAllProcess

public Hashtable getAllProcess()
            throws RemoteException
Get the all Process id with there command line

Returns:
Hashtable the process id and his command line


getProcessCommand

public String getProcessCommand(String id)
            throws ProcessException,
                   RemoteException
Get the Process command line

Parameters:

Returns:
String the process command line

Throws:
ProcessException - if: - The Process id doesn't exist - The Process process is stop


getProcessDirectory

public String getProcessDirectory(String id)
            throws ProcessException,
                   RemoteException
Get the Process directory

Parameters:

Returns:
String the process directory

Throws:
ProcessException - if: - The Process id doesn't exist - The Process process is stop


getProcessExitValue

public int getProcessExitValue(String id)
            throws ProcessException,
                   RemoteException
Test if a Process is not alive the exit value

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


killAllProcesses

public void killAllProcesses()
            throws RemoteException
Kill all processes and remove all process id and configuration


killProcess

public void killProcess(String id)
            throws ProcessException,
                   RemoteException
Kill a process (if existe) and remove it's process id and configuration

Parameters:
id - the Process id

Throws:
ProcessException - if the id doesn't existe


pingProcess

public boolean pingProcess(String id)
            throws ProcessException,
                   RemoteException
Test if a Process is always alive

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


readProcessError

public String readProcessError(String id)
            throws ProcessException,
                   RemoteException
get the rjvm ErrorStream

Parameters:
id - the jvm id

Throws:
ProcessException - if - the id doen'st existe


readProcessOutput

public String readProcessOutput(String id)
            throws ProcessException,
                   RemoteException
get the rproc OutputStream

Parameters:
id - the proc id

Throws:
ProcessException - if - the id doen'st existe


sendFile

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

Parameters:


startJVM

public String startJVM(JVMConfiguration jvmConf,
                       String[] envp)
            throws ProcessException,
                   RemoteException
Start a jvm process on the remote host in a tmp directory

Parameters:

Returns:
String the process id

Throws:
ProcessException - if an exception occurs at bootstrapting


startJVM

public String startJVM(JVMConfiguration jvmConf,
                       String[] envp,
                       String processDir)
            throws ProcessException,
                   RemoteException
Start a jvm process on the remote host

Parameters:

Returns:
String the process id

Throws:
ProcessException - if an exception occurs at bootstrapting


startJVM

public void startJVM(JVMConfiguration jvmConf,
                     String[] envp,
                     String processDir,
                     String id)
            throws ProcessException,
                   RemoteException
Start a jvm process on the remote host

Parameters:


startProcess

public String startProcess(String processLine,
                           String[] envp)
            throws ProcessException,
                   RemoteException
Start a process on the remote host in a tmp directory

Parameters:

Returns:
String the process id

Throws:
ProcessException - if an exception occurs at bootstrapting


startProcess

public String startProcess(String processLine,
                           String[] envp,
                           String processDir)
            throws ProcessException,
                   RemoteException
Start a process on the remote host

Parameters:

Returns:
String the process id

Throws:
ProcessException - if an exception occurs at bootstrapting


startProcess

public void startProcess(String processLine,
                         String[] envp,
                         String processDir,
                         String id)
            throws ProcessException,
                   RemoteException
Start a process on the remote host

Parameters:


stop

public void stop()
            throws RemoteException
Stop the damemon and kill all the process


writeProcessInput

public void writeProcessInput(String id,
                              String s)
            throws ProcessException,
                   RemoteException
send a String to the rjvm inputStream

Parameters:
id - the jvm id
s - String to send to the InputStream

Throws:
ProcessException - if - the id doen'st existe