APIdia Launch Partner
Top Description Fields Methods
java.rmi.server

public Interface RemoteRef

extends Externalizable
Known Direct Subinterfaces
java.rmi.server.ServerRef
Known Direct Implementers
sun.rmi.server.UnicastRef
Imports
java.rmi.*

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.
Author
Ann Wollrath
Since
1.1
See Also
java.rmi.server.RemoteStub

Field Summary

Modifier and TypeField and Description
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.

public static final long
serialVersionUID

Deprecated A serialVersionUID field in an interface is ineffectual. Do not use; no replacement.
indicate compatibility with JDK 1.1.x version of class.

Method Summary

Modifier and TypeMethod and Description
public void
done(RemoteCall
object representing remote call
call
)
Deprecated 1.2 style stubs no longer use this method.

Allows the remote reference to clean up (or reuse) the connection.

public String

Returns:

the class name (without package qualification) of the reference type
getRefClass
(ObjectOutput
the output stream to which the reference will be serialized
out
)

Returns the class name of the ref type to be serialized onto the stream 'out'.

public Object

Returns:

result of remote method invocation
invoke
(Remote
the object that contains the RemoteRef (e.g., the RemoteStub for the object.
obj
,
Method
the method to be invoked
method
,
Object[]
the parameter list
params
,
long
a hash that may be used to represent the method
opnum
)

Invoke a method.

public void
invoke(RemoteCall
object representing remote call
call
)
Deprecated 1.2 style stubs no longer use this method.

Executes the remote call.

public RemoteCall

Returns:

call object representing remote call
newCall
(RemoteObject
remote stub through which to make call
obj
,
Operation[]
array of stub operations
op
,
int
operation number
opnum
,
long
stub/skeleton interface hash
hash
)
Deprecated 1.2 style stubs no longer use this method.

Creates an appropriate call object for a new remote method invocation on this object.

public boolean

Returns:

true if these Objects are equal; false otherwise.
remoteEquals
(RemoteRef
the Object to compare with
obj
)

Compares two remote objects for equality.

public int

Returns:

remote object hashcode
remoteHashCode
()

Returns a hashcode for a remote object.

public String

Returns:

string representing remote object reference
remoteToString
()

Returns a String that represents the reference of this remote object.

Inherited from java.io.Externalizable:
readExternalwriteExternal

Field Detail

packagePrefixback to summary
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.

serialVersionUIDback to summary
public static final long serialVersionUID

Deprecated

A serialVersionUID field in an interface is ineffectual. Do not use; no replacement.

indicate compatibility with JDK 1.1.x version of class.

Annotations
@Deprecated

Method Detail

doneback to summary
public void done(RemoteCall call) throws RemoteException

Deprecated

1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.

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:RemoteCall

object representing remote call

Annotations
@Deprecated
Exceptions
RemoteException:
if remote error occurs during call cleanup
Since
1.1
See Also
invoke(Remote, java.lang.reflect.Method, Object[], long)
getRefClassback to summary
public String getRefClass(ObjectOutput out)

Returns the class name of the ref type to be serialized onto the stream 'out'.

Parameters
out:ObjectOutput

the output stream to which the reference will be serialized

Returns:String

the class name (without package qualification) of the reference type

Since
1.1
invokeback to summary
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:Remote

the object that contains the RemoteRef (e.g., the RemoteStub for the object.

method:Method

the method to be invoked

params:Object[]

the parameter list

opnum:long

a hash that may be used to represent the method

Returns:Object

result of remote method invocation

Exceptions
Exception:
if any exception occurs during remote method invocation
Since
1.2
invokeback to summary
public void invoke(RemoteCall call) throws Exception

Deprecated

1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.

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:RemoteCall

object representing remote call

Annotations
@Deprecated
Exceptions
Exception:
if any exception occurs during remote method
Since
1.1
See Also
invoke(Remote, java.lang.reflect.Method, Object[], long)
newCallback to summary
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException

Deprecated

1.2 style stubs no longer use this method. Instead of using a sequence of method calls on the stub's the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.

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:RemoteObject

remote stub through which to make call

op:Operation[]

array of stub operations

opnum:int

operation number

hash:long

stub/skeleton interface hash

Returns:RemoteCall

call object representing remote call

Annotations
@Deprecated
Exceptions
RemoteException:
if failed to initiate new remote call
Since
1.1
See Also
invoke(Remote, java.lang.reflect.Method, Object[], long)
remoteEqualsback to summary
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:RemoteRef

the Object to compare with

Returns:boolean

true if these Objects are equal; false otherwise.

Since
1.1
See Also
java.util.Hashtable
remoteHashCodeback to summary
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:int

remote object hashcode

Since
1.1
See Also
java.util.Hashtable
remoteToStringback to summary
public String remoteToString()

Returns a String that represents the reference of this remote object.

Returns:String

string representing remote object reference

Since
1.1