|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmapss.dif.util.command.CommandUtilities
public class CommandUtilities
A class that included utilities that interact with the command prompt of the underlying operating system. Note that the executions in ExecutionClient are serial executions though the ExecutionServer is a parallel executing server. Therefore each ExecutionServer will be able to accept multiple communications and run their commands in parallel, assuming that its underlying operating system is a multitasking one. In order to have parallel executions on the client side, multiple threads should be created, each including one ExecutionClient.
It is a known problem that the same CommandUtilities object throws an exception if it is used to run more than two local commands. Therefore it is advisable to use a new object for each new local command. (added by Fuat Keceli)
| Field Summary | |
|---|---|
boolean |
done
|
| Constructor Summary | |
|---|---|
CommandUtilities()
The default constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCommandResult()
Return the execution message the program generates while executing a command using the runRemoteCommand and runCommand methods. |
java.lang.String |
getErrorMessage()
Return the error message the program generates while executing a command using the runRemoteCommand and runCommand methods. |
boolean |
runCommand(java.lang.String[] command)
Runs a command on the local machine and returns true on zero exit. |
boolean |
runRemoteCommand(java.lang.String host,
int hostPort,
java.lang.String[] command)
Runs a command on a remote machine and returns true on zero exit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean done
| Constructor Detail |
|---|
public CommandUtilities()
| Method Detail |
|---|
public java.lang.String getCommandResult()
public java.lang.String getErrorMessage()
public boolean runRemoteCommand(java.lang.String host,
int hostPort,
java.lang.String[] command)
host - The host on which the ExecutionServer is running on.hostPort - The port number which the ExecutionServer is listening
to.command - The command and parameters of the command that it going
to be executed on the host.
public boolean runCommand(java.lang.String[] command)
command - The command and parameters of the command that it going
to be executed on the local machine.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||