public interface RemoteRef extends Externalizable
RemoteRef
represents the handle for a remote object. A RemoteStub
uses a remote reference to carry out a remote method invocation to a remote object.
RemoteStub
static final long serialVersionUID
indicate compatibility with JDK 1.1.x version of class.
static final String packagePrefix
Initialize the server package prefix: assumes that the implementation of server ref classes (e.g., UnicastRef, UnicastServerRef) are located in the package defined by the prefix.
Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception
Invoke a method. This form of delegating method invocation to the reference allows the reference to take care of setting up the connection to the remote host, marshaling some representation for the method and parameters, then communicating the method invocation to the remote host. This method either returns the result of a method invocation on the remote object which resides on the remote host or throws a RemoteException if the call failed or an application-level exception if the remote invocation throws an exception.
obj
- the object that contains the RemoteRef (e.g., the RemoteStub for the object.method
- the method to be invokedparams
- the parameter listopnum
- a hash that may be used to represent the methodException
- if any exception occurs during remote method invocation@Deprecated RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException
Deprecated. 1.2 style stubs no longer use this method. Instead of using a sequence of method calls on the stub's the remote reference (newCall
, invoke
, and done
), a stub uses a single method, invoke(Remote, Method, Object[],
int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
Creates an appropriate call object for a new remote method invocation on this object. Passing operation array and index, allows the stubs generator to assign the operation indexes and interpret them. The remote reference may need the operation to encode in the call.
obj
- remote stub through which to make callop
- array of stub operationsopnum
- operation numberhash
- stub/skeleton interface hashRemoteException
- if failed to initiate new remote callinvoke(Remote,java.lang.reflect.Method,Object[],long)
@Deprecated void invoke(RemoteCall call) throws Exception
Deprecated. 1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall
, invoke
, and done
), a stub uses a single method, invoke(Remote, Method, Object[],
int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
Executes the remote call. Invoke will raise any "user" exceptions which should pass through and not be caught by the stub. If any exception is raised during the remote invocation, invoke should take care of cleaning up the connection before raising the "user" or remote exception.
call
- object representing remote callException
- if any exception occurs during remote methodinvoke(Remote,java.lang.reflect.Method,Object[],long)
@Deprecated void done(RemoteCall call) throws RemoteException
Deprecated. 1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall
, invoke
, and done
), a stub uses a single method, invoke(Remote, Method, Object[],
int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
Allows the remote reference to clean up (or reuse) the connection. Done should only be called if the invoke returns successfully (non-exceptionally) to the stub.
call
- object representing remote callRemoteException
- if remote error occurs during call cleanupinvoke(Remote,java.lang.reflect.Method,Object[],long)
String getRefClass(ObjectOutput out)
Returns the class name of the ref type to be serialized onto the stream 'out'.
out
- the output stream to which the reference will be serializedint remoteHashCode()
Returns a hashcode for a remote object. Two remote object stubs that refer to the same remote object will have the same hash code (in order to support remote objects as keys in hash tables).
Hashtable
boolean remoteEquals(RemoteRef obj)
Compares two remote objects for equality. Returns a boolean that indicates whether this remote object is equivalent to the specified Object. This method is used when a remote object is stored in a hashtable.
obj
- the Object to compare withHashtable
String remoteToString()
Returns a String that represents the reference of this remote object.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.