|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.remote.RemoteProcess
Serializable handle to a native process running on a remote machine. Communicates via RMI with the process handle at the server side. Since the handle is serializable, it can be sent over RMI (e.g. returned from a remote call). For example:
RemoteProcess getRemoteProcess() throws RemoteException { // locate (or start) nativeProcess // ... return new RemoteProcess(nativeProcess); }
Constructor Summary | |
RemoteProcess()
for deserialization only |
|
RemoteProcess(java.lang.Process process)
Constructs a new serializable remote reference to the specified process. |
|
RemoteProcess(RemoteProcessSrv server)
Constructs a new serializable remote reference to a remote process. |
Method Summary | |
void |
destroy()
Destroys the remote process. |
int |
exitValue()
Returns the exit value for the remote process. |
java.io.InputStream |
getErrorStream()
Gets the remote error stream of the remote process. |
java.io.InputStream |
getInputStream()
Gets the remote input stream of the remote process. |
java.io.OutputStream |
getOutputStream()
Gets the remote output stream of the remote process. |
void |
readExternal(java.io.ObjectInput in)
|
int |
waitFor()
Causes the current thread to wait, if necessary, until the remote process has terminated. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RemoteProcess()
public RemoteProcess(java.lang.Process process)
process
- the process to create the reference topublic RemoteProcess(RemoteProcessSrv server)
server
- the RMI handle to the processMethod Detail |
public void destroy() throws java.rmi.RemoteException
java.rmi.RemoteException
- upon a communication failurepublic int exitValue() throws java.rmi.RemoteException
0
indicates normal termination.
java.rmi.RemoteException
- upon a communication failure
java.lang.IllegalThreadStateException
- if the remote process
has not yet terminatedpublic int waitFor() throws java.rmi.RemoteException, java.lang.InterruptedException
0
indicates normal termination
java.rmi.RemoteException
- upon a communication failure
java.lang.InterruptedException
- if the current thread is
interrupted
by another thread
while it is waitingpublic java.io.InputStream getInputStream()
Implementation note: It is a good idea for the input stream to be buffered.
java.rmi.RemoteException
- upon a communication failurepublic java.io.InputStream getErrorStream()
Implementation note: It is a good idea for the input stream to be buffered.
java.rmi.RemoteException
- upon a communication failurepublic java.io.OutputStream getOutputStream()
Implementation note: It is a good idea for the output stream to be buffered.
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |