org.objectweb.carol.util.bootstrap
Interface RemoteProcessesManager

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
ProcessesManager

public interface RemoteProcessesManager
extends java.rmi.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
 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
 int getProcessExitValue(java.lang.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(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
 

Method Detail

startJVM

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

Returns:
String the process id
Throws:
ProcessException - if an exception occurs at bootstrapting
java.rmi.RemoteException

startJVM

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

Returns:
String the process id
Throws:
ProcessException - if an exception occurs at bootstrapting
java.rmi.RemoteException

startJVM

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

Throws:
RProcessException - if an exception occurs at bootstrapting
ProcessException
java.rmi.RemoteException

startProcess

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

Returns:
String the process id
Throws:
ProcessException - if an exception occurs at bootstrapting
java.rmi.RemoteException

startProcess

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

Returns:
String the process id
Throws:
ProcessException - if an exception occurs at bootstrapting
java.rmi.RemoteException

startProcess

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

Throws:
RProcessException - if an exception occurs at bootstrapting
ProcessException
java.rmi.RemoteException

killProcess

public void killProcess(java.lang.String id)
                 throws ProcessException,
                        java.rmi.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
java.rmi.RemoteException

killAllProcesses

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

Throws:
java.rmi.RemoteException

pingProcess

public boolean pingProcess(java.lang.String id)
                    throws ProcessException,
                           java.rmi.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
Throws:
ProcessException
java.rmi.RemoteException

getProcessExitValue

public int getProcessExitValue(java.lang.String id)
                        throws ProcessException,
                               java.rmi.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
java.rmi.RemoteException

getProcessCommand

public java.lang.String getProcessCommand(java.lang.String id)
                                   throws ProcessException,
                                          java.rmi.RemoteException
Get the Process command line

Returns:
String the process command line
Throws:
ProcessException - if: - The Process id doesn't exist - The Process process is stop
java.rmi.RemoteException

getProcessDirectory

public java.lang.String getProcessDirectory(java.lang.String id)
                                     throws ProcessException,
                                            java.rmi.RemoteException
Get the Process directory

Returns:
String the process directory
Throws:
ProcessException - if: - The Process id doesn't exist - The Process process is stop
java.rmi.RemoteException

getAllProcess

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

Returns:
Hashtable the process id and his command line
Throws:
java.rmi.RemoteException

readProcessOutput

public java.lang.String readProcessOutput(java.lang.String id)
                                   throws ProcessException,
                                          java.rmi.RemoteException
get the rproc OutputStream

Parameters:
id - the proc id
Throws:
ProcessException - if - the id doen'st existe
java.rmi.RemoteException

readProcessError

public java.lang.String readProcessError(java.lang.String id)
                                  throws ProcessException,
                                         java.rmi.RemoteException
get the rjvm ErrorStream

Parameters:
id - the jvm id
Throws:
ProcessException - if - the id doen'st existe
java.rmi.RemoteException

writeProcessInput

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

Parameters:
s - String to send to the InputStream
id - the jvm id
Throws:
ProcessException - if - the id doen'st existe
java.rmi.RemoteException

sendFile

public void sendFile(java.lang.String dirName,
                     java.lang.String fileName,
                     byte[] b)
              throws java.rmi.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

Throws:
java.rmi.RemoteException

stop

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

Throws:
java.rmi.RemoteException