java.rmi.server

Interface RemoteRef

public interface RemoteRef extends Externalizable

Represents a handler to the remote object. Each instance of the {@link RemoteStub} contains such handler and uses it to invoke remote methods via {@link #invoke(Remote, Method, Object[], long)}.
Field Summary
StringpackagePrefix
For binary compatibility with the JDK, the string "sun.rmi.server".
longserialVersionUID
Indicates compatibility with JDK 1.1.*
Method Summary
voiddone(RemoteCall call)
StringgetRefClass(ObjectOutput out)
Returns the class name of the reference type that must be written to the given stream.
voidinvoke(RemoteCall call)
Objectinvoke(Remote obj, Method method, Object[] params, long methodHash)
Invoke a method.
RemoteCallnewCall(RemoteObject obj, Operation[] op, int opnum, long hash)
booleanremoteEquals(RemoteRef ref)
Compare two remote objects for equality.
intremoteHashCode()
Get the hashcode for a remote object.
StringremoteToString()
Get the string representation of this remote reference.

Field Detail

packagePrefix

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

serialVersionUID

public long serialVersionUID
Indicates compatibility with JDK 1.1.*

Method Detail

done

public void done(RemoteCall call)

Deprecated: use {@link #invoke(Remote, Method, Object[], long)} instead.

getRefClass

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

invoke

public void invoke(RemoteCall call)

Deprecated: use {@link #invoke(Remote, Method, Object[], long)} instead.

invoke

public Object invoke(Remote obj, Method method, Object[] params, long methodHash)
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

public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash)

Deprecated: use {@link #invoke(Remote, Method, Object[], long)} instead.

remoteEquals

public 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

public 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

remoteToString

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

Returns: the string representation.