Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

J2ME RMI Optional Package

java.rmi.server
Interface RemoteRef

All Superinterfaces:
java.io.Externalizable, java.io.Serializable

public interface RemoteRef
extends java.io.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.

Since:
JDK1.1
See Also:
RemoteStub

Field Summary
static java.lang.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
 java.lang.String getRefClass(java.io.ObjectOutput out)
          Returns the class name of the ref type to be serialized onto the stream 'out'.
 java.lang.Object invoke(Remote obj, java.lang.reflect.Method method, java.lang.Object[] params, long opnum)
          Invoke a method.
 boolean remoteEquals(RemoteRef obj)
          Compares two remote objects for equality.
 int remoteHashCode()
          Returns a hashcode for a remote object.
 java.lang.String remoteToString()
          Returns a String that represents the reference of this remote object.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

serialVersionUID

public static final long serialVersionUID
indicate compatibility with JDK 1.1.x version of class.

packagePrefix

public static final java.lang.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.
Method Detail

invoke

public java.lang.Object invoke(Remote obj,
                               java.lang.reflect.Method method,
                               java.lang.Object[] params,
                               long opnum)
                        throws java.lang.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.
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:
java.lang.Exception - if any exception occurs during remote method invocation
Since:
1.2

getRefClass

public java.lang.String getRefClass(java.io.ObjectOutput 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

public 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

remoteEquals

public 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.
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
Since:
JDK1.1
See Also:
Hashtable

remoteToString

public java.lang.String remoteToString()
Returns a String that represents the reference of this remote object.
Returns:
string representing remote object reference
Since:
JDK1.1

J2ME RMI Optional Package

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 66 specification.