| CONTENTS | PREV | NEXT | Java Remote Method Invocation |
RemoteCall Interface
The interfaceRemoteCallis an abstraction used by the stubs and skeletons of remote objects to carry out a call to a remote object.
Note - TheRemoteCallinterface is deprecated as of the Java 2 SDK, Standard Edition, v1.2. The 1.2 stub protocol does not make use of this interface anymore. As of the Java 2 SDK, Standard Edition, v1.2, stubs now use the newinvokemethod which does not requireRemoteCallas a parameter.
package java.rmi.server;
import java.io.*;
public interface RemoteCall {
ObjectOutput getOutputStream() throws IOException;
void releaseOutputStream() throws IOException;
ObjectInput getInputStream() throws IOException;
void releaseInputStream() throws IOException;
ObjectOutput getResultStream(boolean success)
throws IOException, StreamCorruptedException;
void executeCall() throws Exception;
void done() throws IOException;
}
The methodgetOutputStreamreturns the output stream into which either the stub marshals arguments or the skeleton marshals results.The method
releaseOutputStreamreleases the output stream; in some transports this will release the stream.The method
getInputStreamreturns theInputStreamfrom which the stub unmarshals results or the skeleton unmarshals parameters.The method
releaseInputStreamreleases the input stream. This will allow some transports to release the input side of a connection early.The method
getResultStreamreturns an output stream (after writing out header information relating to the success of the call). Obtaining a result stream should only succeed once per remote call. If success istrue, then the result to be marshaled is a normal return; otherwise the result is an exception.StreamCorruptedExceptionis thrown if the result stream has already been obtained for this remote call.The method
executeCalldoes whatever it takes to execute the call.The method
doneallows cleanup after the remote call has completed.