Spec-Zone .ru
спецификации, руководства, описания, API
|
CONTENTS | PREV | NEXT | Java Remote Method Invocation |
RemoteCall
Interface
The interfaceRemoteCall
is an abstraction used by the stubs and skeletons of remote objects to carry out a call to a remote object.
Note - TheRemoteCall
interface 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 newinvoke
method which does not requireRemoteCall
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 methodgetOutputStream
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 theInputStream
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 istrue
, 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.