|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class implementing this interface is able to start a process based on a command to execute. The command is built from arbitrary parameters (up to the implementation) and from the environment. The external process can be customized up to the moment it is started. Once started the call to methods to set the command throw an exception.
Field Summary | |
static org.apache.log4j.Logger |
logger
|
Method Summary | |
java.lang.String |
getCommand()
Returns the command that will be or has been execute by the process. |
java.lang.String |
getCommandPath()
Returns the path of the command to be executed by this process |
java.lang.String[] |
getEnvironment()
Returns the current environment for this process. |
UniversalProcess |
getFinalProcess()
Returns the last process of the chain |
java.lang.String |
getHostname()
Return the hostname target of this process. |
int |
getNodeNumber()
Returns the number of nodes targeted |
java.lang.String |
getProcessId()
Returns the id of the process |
java.lang.String |
getUsername()
Return the username that will be used to run the command. |
boolean |
isFinished()
Returns true if and only if this process has been stopped. |
boolean |
isStarted()
Returns true if and only if this process has been started. |
void |
setCommandPath(java.lang.String path)
Sets the path of the command to be executed by this process |
void |
setEnvironment(java.lang.String[] environment)
Set the environment for this process. |
void |
setHostname(java.lang.String hostname)
Set the hostname target of this process. |
void |
setUsername(java.lang.String username)
Set the username that will be used to run the command. |
void |
startProcess()
Starts the process by executing the command. |
void |
stopProcess()
Stops the running process. |
int |
waitFor()
Causes the current thread to wait until this Process has terminated. |
Field Detail |
public static final org.apache.log4j.Logger logger
Method Detail |
public java.lang.String[] getEnvironment()
public void setEnvironment(java.lang.String[] environment)
environment
- an array of string containing all environment variables or
null if the environment is emptypublic java.lang.String getHostname()
public void setHostname(java.lang.String hostname)
hostname
- the target hostname.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- the target username or null to use the default one.public java.lang.String getCommand()
public java.lang.String getProcessId()
public int getNodeNumber()
public UniversalProcess getFinalProcess()
public void startProcess() throws java.io.IOException
java.io.IOException
- if the process cannot be started.public void stopProcess()
public int waitFor() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the current thread is interrupted by another thread while it is waiting.
Then the wait is ended and an InterruptedException is thrownpublic boolean isStarted()
public boolean isFinished()
public void setCommandPath(java.lang.String path)
public java.lang.String getCommandPath()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |