|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FIJobCanceler
The FIJobCanceler interface provides methods that create commands that need to be executed on remote host in order to find process ids of remote processes based on their executable and the executing user as well as commands that need to be executed to kill processes on remote computers. The interface is used by the SSH Resource Manager to cancel remote processes. Depending on the operating system of the remote machine there are different ways for finding out the PID of a process and for killing processes. In order to implement this interface there are five methods that need to be implemented:
getPIDCommand(String, String)getPIDFromResponse(String)getKillCommand(int)getConfirmKillCommand(int)confirmKill(String)getPIDCommand(String, String)
is executed on the remote host in order to find out the process id of the newly
started process. The output of that command is then passed on to the method
getPIDFromResponse(String). This method has to parse the response, extract
the process id and return it.
When an application needs to be canceled, a new SSH-channel is opened and the
command returned by getKillCommand(int) is executed. In order to make sure that
the remote process was actually killed, another command will be executed which is
requested from the getConfirmKillCommand(int) method. The output of that command
is then passed on to the confirmKill(String) method which has to parse it
and determine whether the response is to be interpreted as success or failure.
| Method Summary | |
|---|---|
boolean |
confirmKill(java.lang.String response)
After a kill command was issued confirmKill(String) tries to find out whether
the remote process was successfully killed. |
java.lang.String |
getConfirmKillCommand(int pid)
Method that returns command to issue to find out whether killing of a process succeeded. |
java.lang.String |
getKillCommand(int pid)
Method to determine the command to send to the remote host in order to kill the process with the previously determined PID. |
java.lang.String |
getPIDCommand(java.lang.String exe,
java.lang.String user)
Method that returns the command to issue in order to determine a program's PID. |
int |
getPIDFromResponse(java.lang.String response)
Method that parses the remote hosts's response to the PID request |
| Method Detail |
|---|
java.lang.String getPIDCommand(java.lang.String exe,
java.lang.String user)
exe - The program to determine the PID foruser - The user that submitted the program
int getPIDFromResponse(java.lang.String response)
response - The response read after issuing the command
returned from getPIDCommand(String, String).
java.lang.String getKillCommand(int pid)
pid - The process id of the process to kill
java.lang.String getConfirmKillCommand(int pid)
pid - The process id of the process that should be searched
boolean confirmKill(java.lang.String response)
confirmKill(String) tries to find out whether
the remote process was successfully killed. This method is used to parse the
answer received after the command returned from getConfirmKillCommand(int)
was executed on the remote host.
response - The response received from the remote host after getConfirmKillCommand(int)
was executed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||