|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.util.command.ExecutionClient
public class ExecutionClient
The ExecutionClient encapsulates the spawning of the target application and target to driver application communication.
Field Summary | |
---|---|
static int |
ATTACHED
Type of execution in which the executing command (target application) remains connected to the communication channel and sends/receives data to the ExecutionClient through the created socket. |
static int |
DETACHED
Type of execution in which the executing command (target application) disconnects from the ExecutionServer, and does not communicate with the ExecutionClient. |
Constructor Summary | |
---|---|
ExecutionClient(int executionType,
java.lang.String host,
int hostPort,
java.lang.String[] args)
Sets the execution of the target application in either attached or detached mode on a given host. |
Method Summary | |
---|---|
int |
available()
Return the number of bytes available to read from the input stream. |
void |
close()
Closes the socket input and output streams. |
java.lang.String |
read(byte terminator)
Read a stream of bytes from the input stream until the terminator is encountered. |
int |
read(byte[] byteBuffer,
int length)
Reads a block of data from the input stream into a given buffer. |
void |
write(byte[] byteBuffer,
byte terminator)
Writes a buffer to the output stream , terminated with the specified terminator to the output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ATTACHED
public static final int DETACHED
Constructor Detail |
---|
public ExecutionClient(int executionType, java.lang.String host, int hostPort, java.lang.String[] args) throws RemoteExecutionException
executionType
- The type of execution we want to have on the server
which is either ATTACHED or DETACHED.host
- The host on which the ExecutionServer is running on.hostPort
- The port number which the ExecutionServer is listening
to.args
- The command and parameters of the command that it going
to be executed on the host.
RemoteExecutionException
- If the Client was not able to
communicate with the server.Method Detail |
---|
public void write(byte[] byteBuffer, byte terminator) throws java.io.IOException
byteBuffer
- The byte stream to be written.terminator
- The character to put at the end of the stream after
writing the buffer to it.
java.io.IOException
public int read(byte[] byteBuffer, int length) throws java.io.IOException
byteBuffer
- The given buffer.length
- The length of the block of data to be read.
java.io.IOException
public java.lang.String read(byte terminator) throws java.io.IOException
terminator
- The character to use as terminator in the input
stream.
java.io.IOException
public int available() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
- If fails to close the streams.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |