Java Platform 1.2
Beta 4

Interface java.rmi.server.RemoteRef

All Known Subinterfaces:
ServerRef

public abstract interface RemoteRef
extends Externalizable
RemoteRef represents the handle for a remote object.


Field Summary
static String packagePrefix
          Initialize the server package prefix: assumes that the implementation of server ref classes (e.g.
static long serialVersionUID
           
 
Fields inherited from class java.io.Serializable
serialVersionUID
 
Method Summary
 void done(RemoteCall call)
          Allows the remote reference to clean up (or reuse) the connection.
 String getRefClass(ObjectOutput out)
          Returns the class name of the ref type to be serialized onto the stream 'out'.
 Object invoke(Remote obj, Method method, Object[] params, long opnum)
          Invoke a method.
 void invoke(RemoteCall call)
          Executes the remote call.
 RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash)
          Creates an appropriate call object for a new remote method invocation on this object.
 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
readExternal , writeExternal
 

Field Detail

serialVersionUID

public static final long serialVersionUID

packagePrefix

public 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.
Method Detail

invoke

public 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.
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
Since:
JDK1.2

newCall

public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
                   throws RemoteException
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.
Throws:
RemoteException - if registry could not be contacted.

invoke

public void invoke(RemoteCall call)
            throws Exception
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.
Throws:
Exception - if a general exception occurs.

done

public void done(RemoteCall call)
          throws RemoteException
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.
Throws:
RemoteException - if registry could not be contacted.

getRefClass

public String getRefClass(ObjectOutput out)
Returns the class name of the ref type to be serialized onto the stream 'out'.

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).
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.
See Also:
Hashtable

remoteToString

public String remoteToString()
Returns a String that represents the reference of this remote object.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.