java.rmi.server
Interface RemoteRef

All Superinterfaces:
Externalizable, Serializable
All Known Subinterfaces:
ServerRef

public interface RemoteRef
extends Externalizable

Represents a handler to the remote object. Each instance of the RemoteStub contains such handler and uses it to invoke remote methods via invoke(Remote, Method, Object[], long).


Field Summary
static String packagePrefix
          For binary compatibility with the JDK, the string "sun.rmi.server".
static long serialVersionUID
          Indicates compatibility with JDK 1.1
 
Method Summary
 void done(RemoteCall call)
          Deprecated. use invoke(Remote, Method, Object[], long) instead.
 String getRefClass(ObjectOutput out)
          Returns the class name of the reference type that must be written to the given stream.
 void invoke(RemoteCall call)
          Deprecated. use invoke(Remote, Method, Object[], long) instead.
 Object invoke(Remote obj, Method method, Object[] params, long methodHash)
          Invoke a method.
 RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash)
          Deprecated. use invoke(Remote, Method, Object[], long) instead.
 boolean remoteEquals(RemoteRef ref)
          Compare two remote objects for equality.
 int remoteHashCode()
          Get the hashcode for a remote object.
 String remoteToString()
          Get the string representation of this remote reference.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

serialVersionUID

static final long serialVersionUID
Indicates compatibility with JDK 1.1.*

See Also:
Constant Field Values

packagePrefix

static final String packagePrefix
For binary compatibility with the JDK, the string "sun.rmi.server". Not actually used for anything.

See Also:
Constant Field Values
Method Detail

invoke

void invoke(RemoteCall call)
            throws Exception
Deprecated. use invoke(Remote, Method, Object[], long) instead.

Throws:
Exception

invoke

Object invoke(Remote obj,
              Method method,
              Object[] params,
              long methodHash)
              throws Exception
Invoke a method. This method either returns the result of remote invocation or throws RemoteException if the remote call failed. Other exceptions may be thrown if some problem has occured in the application level.

Parameters:
obj - the object, containing the remote reference (for instance, remote stub, generated by rmic).
method - the method to invoke
params - the method parameters
methodHash - a persistent hash code that can be used to represent a method
Returns:
the result of the remote invocation
Throws:
RemoteException - if the remote call has failed
Exception - if one is raised at the application level

newCall

RemoteCall newCall(RemoteObject obj,
                   Operation[] op,
                   int opnum,
                   long hash)
                   throws RemoteException
Deprecated. use invoke(Remote, Method, Object[], long) instead.

Throws:
RemoteException

done

void done(RemoteCall call)
          throws RemoteException
Deprecated. use invoke(Remote, Method, Object[], long) instead.

Throws:
RemoteException

remoteEquals

boolean remoteEquals(RemoteRef ref)
Compare two remote objects for equality. The references are equal if they point to the same remote object.

Parameters:
ref - the reference to compare.
Returns:
true if this and passed references both point to the same remote object, false otherwise.

remoteHashCode

int remoteHashCode()
Get the hashcode for a remote object. Two remote object stubs, referring to the same remote object, have the same hash code.

Returns:
the hashcode of the remote object

getRefClass

String getRefClass(ObjectOutput out)
Returns the class name of the reference type that must be written to the given stream. When writing, this returned name is passed first, and the reference.writeExternal(out) writes the reference specific data.

Parameters:
out - the stream, where the data must be written
Returns:
the class name.

remoteToString

String remoteToString()
Get the string representation of this remote reference.

Returns:
the string representation.