RemoteRef (Java Platform SE 8 ) (original) (raw)
- All Superinterfaces:
Externalizable, Serializable
All Known Subinterfaces:
ServerRef
public interface RemoteRef
extends ExternalizableRemoteRef
represents the handle for a remote object. ARemoteStub
uses a remote reference to carry out a remote method invocation to a remote object.
Since:
JDK1.1
See Also:
RemoteStub
Field Summary
Fields
Modifier and Type Field Description static 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. static long serialVersionUID indicate compatibility with JDK 1.1.x version of class. Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods
Modifier and Type Method Description void done(RemoteCall call) Deprecated. String getRefClass(ObjectOutput out) Returns the class name of the ref type to be serialized onto the stream 'out'. void invoke(RemoteCall call) Deprecated. Object invoke(Remote obj,Method method,Object[] params, long opnum) Invoke a method. RemoteCall newCall(RemoteObject obj,Operation[] op, int opnum, long hash) Deprecated. boolean remoteEquals(RemoteRef obj) Compares two remote objects for equality. int remoteHashCode() Returns a hashcode for a remote object. String remoteToString() Returns a String that represents the reference of this remote object. * ### Methods inherited from interface java.io.[Externalizable](../../../java/io/Externalizable.html "interface in java.io") `[readExternal](../../../java/io/Externalizable.html#readExternal-java.io.ObjectInput-), [writeExternal](../../../java/io/Externalizable.html#writeExternal-java.io.ObjectOutput-)`
Field Detail
* #### serialVersionUID static final long serialVersionUID indicate compatibility with JDK 1.1.x version of class. See Also: [Constant Field Values](../../../constant-values.html#java.rmi.server.RemoteRef.serialVersionUID) * #### packagePrefix static final [String](../../../java/lang/String.html "class in java.lang") 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. See Also: [Constant Field Values](../../../constant-values.html#java.rmi.server.RemoteRef.packagePrefix)
Method Detail
* #### invoke [Object](../../../java/lang/Object.html "class in java.lang") invoke([Remote](../../../java/rmi/Remote.html "interface in java.rmi") obj, [Method](../../../java/lang/reflect/Method.html "class in java.lang.reflect") method, [Object](../../../java/lang/Object.html "class in java.lang")[] params, long opnum) throws [Exception](../../../java/lang/Exception.html "class in java.lang") 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. Parameters: `obj` \- the object that contains the RemoteRef (e.g., the RemoteStub for the object. `method` \- the method to be invoked `params` \- the parameter list `opnum` \- a hash that may be used to represent the method Returns: result of remote method invocation Throws: `[Exception](../../../java/lang/Exception.html "class in java.lang")` \- if any exception occurs during remote method invocation Since: 1.2 * #### newCall [@Deprecated](../../../java/lang/Deprecated.html "annotation in java.lang") [RemoteCall](../../../java/rmi/server/RemoteCall.html "interface in java.rmi.server") newCall([RemoteObject](../../../java/rmi/server/RemoteObject.html "class in java.rmi.server") obj, [Operation](../../../java/rmi/server/Operation.html "class in java.rmi.server")[] op, int opnum, long hash) throws [RemoteException](../../../java/rmi/RemoteException.html "class in java.rmi") Deprecated. 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. Parameters: `obj` \- remote stub through which to make call `op` \- array of stub operations `opnum` \- operation number `hash` \- stub/skeleton interface hash Returns: call object representing remote call Throws: `[RemoteException](../../../java/rmi/RemoteException.html "class in java.rmi")` \- if failed to initiate new remote call Since: JDK1.1 See Also: [invoke(Remote,java.lang.reflect.Method,Object\[\],long)](../../../java/rmi/server/RemoteRef.html#invoke-java.rmi.Remote-java.lang.reflect.Method-java.lang.Object:A-long-) * #### invoke [@Deprecated](../../../java/lang/Deprecated.html "annotation in java.lang") void invoke([RemoteCall](../../../java/rmi/server/RemoteCall.html "interface in java.rmi.server") call) throws [Exception](../../../java/lang/Exception.html "class in java.lang") Deprecated. 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. Parameters: `call` \- object representing remote call Throws: `[Exception](../../../java/lang/Exception.html "class in java.lang")` \- if any exception occurs during remote method Since: JDK1.1 See Also: [invoke(Remote,java.lang.reflect.Method,Object\[\],long)](../../../java/rmi/server/RemoteRef.html#invoke-java.rmi.Remote-java.lang.reflect.Method-java.lang.Object:A-long-) * #### done [@Deprecated](../../../java/lang/Deprecated.html "annotation in java.lang") void done([RemoteCall](../../../java/rmi/server/RemoteCall.html "interface in java.rmi.server") call) throws [RemoteException](../../../java/rmi/RemoteException.html "class in java.rmi") Deprecated. 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. Parameters: `call` \- object representing remote call Throws: `[RemoteException](../../../java/rmi/RemoteException.html "class in java.rmi")` \- if remote error occurs during call cleanup Since: JDK1.1 See Also: [invoke(Remote,java.lang.reflect.Method,Object\[\],long)](../../../java/rmi/server/RemoteRef.html#invoke-java.rmi.Remote-java.lang.reflect.Method-java.lang.Object:A-long-) * #### getRefClass [String](../../../java/lang/String.html "class in java.lang") getRefClass([ObjectOutput](../../../java/io/ObjectOutput.html "interface in java.io") out) Returns the class name of the ref type to be serialized onto the stream 'out'. Parameters: `out` \- the output stream to which the reference will be serialized Returns: the class name (without package qualification) of the reference type Since: JDK1.1 * #### remoteHashCode int 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). Returns: remote object hashcode Since: JDK1.1 See Also: [Hashtable](../../../java/util/Hashtable.html "class in java.util") * #### remoteEquals boolean remoteEquals([RemoteRef](../../../java/rmi/server/RemoteRef.html "interface in java.rmi.server") 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. Parameters: `obj` \- the Object to compare with Returns: true if these Objects are equal; false otherwise. Since: JDK1.1 See Also: [Hashtable](../../../java/util/Hashtable.html "class in java.util") * #### remoteToString [String](../../../java/lang/String.html "class in java.lang") remoteToString() Returns a String that represents the reference of this remote object. Returns: string representing remote object reference Since: JDK1.1
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.