public class Ref extends Object implements RemoteRef, Constants
RemoteRef
interface for this
RMI implementation. Instances of this class are passed to a Remote
object's RemoteStub
implementation.
These instances then get serialized and sent to the RMI client.packagePrefix, serialVersionUID
DGC_PING, METHOD_CALL, METHOD_ERROR, METHOD_RESULT, SYSTEM_ERROR
Constructor and Description |
---|
Ref()
Public noargs constructor required for serialization.
|
Ref(String host,
int port,
ObjID oid,
ClientInterceptor clint)
Constructs a Ref instance.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(Ref ref)
Make this Ref instance identical to the given Ref.
|
void |
done(RemoteCall call)
Delegates to
RemoteCall #done(). |
void |
finalize() |
String |
getHost()
Returns the remote host pointed to by this Ref.
|
ObjID |
getOID()
Returns the oid of this Ref.
|
int |
getPort()
Returns the port on the remote host pointed to by this Ref.
|
String |
getRefClass(ObjectOutput out)
Returns null.
|
void |
invoke(RemoteCall call)
Delegates to
RemoteCall.executeCall() . |
Object |
invoke(Remote rem,
Method meth,
Object[] args,
long hash) |
RemoteCall |
newCall(RemoteObject obj,
Operation[] ops,
int opnum,
long hash)
Returns a new
RemoteCall object. |
void |
readExternal(ObjectInput in) |
boolean |
remoteEquals(RemoteRef obj) |
int |
remoteHashCode() |
String |
remoteToString() |
void |
writeExternal(ObjectOutput out) |
public Ref()
public Ref(String host, int port, ObjID oid, ClientInterceptor clint)
host
- the remote hostport
- the port on the remote hostoid
- the ObjID of the remote objectclint
- a ClientInterceptor or nullpublic ObjID getOID()
public String getHost()
public int getPort()
public void connect(Ref ref)
ref
- the ref to duplicatepublic RemoteCall newCall(RemoteObject obj, Operation[] ops, int opnum, long hash)
RemoteCall
object. This is only used for
v1.1 stubs.public void invoke(RemoteCall call) throws Exception
RemoteCall.executeCall()
.invoke
in interface RemoteRef
call
- the RemoteCall obtained from invoking newCall(RemoteObject, Operation[], int, long)
Exception
public void done(RemoteCall call)
RemoteCall
#done().done
in interface RemoteRef
call
- the RemoteCall obtained from invoking newCall(RemoteObject, Operation[], int, long)
public String getRefClass(ObjectOutput out)
RemoteObject
implementation that this Ref should be
serialized and sent directly to the client rather than being
replaced with a RemoteRef
implementation from the
client's RMI system.getRefClass
in interface RemoteRef
out
- this is ignoredpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public boolean remoteEquals(RemoteRef obj)
remoteEquals
in interface RemoteRef
public int remoteHashCode()
remoteHashCode
in interface RemoteRef
public String remoteToString()
remoteToString
in interface RemoteRef