CONTENTS | PREV | NEXT Java Remote Method Invocation


8.2 The RemoteCall Interface

The interface RemoteCall is an abstraction used by the stubs and skeletons of remote objects to carry out a call to a remote object.


Note - The RemoteCall interface is deprecated in JDK 1.2. The JDK 1.2 stub protocol does not make use of this interface anymore. In JDK 1.2, stubs now use the new invoke method which does not require RemoteCall as 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 method getOutputStream returns the output stream into which either the stub marshals arguments or the skeleton marshals results.

The method releaseOutputStream releases the output stream; in some transports this will release the stream.

The method getInputStream returns the InputStream from which the stub unmarshals results or the skeleton unmarshals parameters.

The method releaseInputStream releases the input stream. This will allow some transports to release the input side of a connection early.

The method getResultStream returns 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 is true, then the result to be marshaled is a normal return; otherwise the result is an exception. StreamCorruptedException is thrown if the result stream has already been obtained for this remote call.

The method executeCall does whatever it takes to execute the call.

The method done allows cleanup after the remote call has completed.



CONTENTS | PREV | NEXT
Copyright © 1997-1998 Sun Microsystems, Inc. All Rights Reserved.