All Packages Class Hierarchy This Package Previous Next Index
Class ninja.rmi.NinjaRemoteRef
java.lang.Object
|
+----ninja.rmi.NinjaRemoteRef
- public class NinjaRemoteRef
- extends Object
- implements Serializable
NinjaRemoteRef is the client-side reference to a remote object.
The NinjaRemoteRef is contained within the client-side stub (which
has been obtained from the registry). Users shouldn't need to deal
with the NinjaRemoteRef at all; it is made public simply so that
the generated stubs can access it.
The idea is that the RMI server-side code instantiates the
stub and creates a NinjaRemoteRef and shoves it into the stub. The
stub is then handed to the registry, which passes it along to clients.
Therefore, the methods in NinjaRemoteRef need to be accessible to
the stub (to make remote calls) and to the Ninja RMI server code (to
create the NinjaRemoteRef when exporting a NinjaRemoteObject).
-
commtype
-
-
objid
-
-
remotehost
-
-
remoteport
-
-
NinjaRemoteRef()
-
-
NinjaRemoteRef(String, int, ObjID, int)
- Creates a NinjaRemoteRef which points to the object on the given
hostname and port with the given object ID.
-
done(NinjaRemoteCall)
- Finishes the remote method invocation.
-
get_commtype()
- Returns the communications type of the connection used by this
NinjaRemoteRef.
-
get_objid()
- Returns the object ID which this NinjaRemoteRef refers to.
-
get_remotehost()
- Returns the fully-qualified hostname of the machine which this
NinjaRemoteRef connects to.
-
get_remoteport()
- Returns the port number of the machine which this NinjaRemoteRef
connects to.
-
getRefClass(ObjectOutput)
- Used to obtain the classname of the remote reference for serialization
purposes.
-
invoke(NinjaRemoteCall)
- Invokes the method on the remote object for the given RemoteCall.
-
invoke(Remote, Method, Object[], long)
- Invokes the given method with the given params on the remote object.
-
newCall(int, long)
- Returns a NinjaRemoteCall, used by the stub to make method calls on the
remote object.
-
readExternal(ObjectInput)
- readExternal is called on the NinjaRemoteRef when the stub is
serialized over the network.
-
remoteEquals(NinjaRemoteRef)
- Determines if two NinjaRemoteRef's are equal - used by the stub.
-
remoteHashCode()
- Returns a hashcode on the remote reference.
-
remoteToString()
- Returns a string representing this remote reference.
-
writeExternal(ObjectOutput)
- writeExternal is called on the NinjaRemoteRef when the stub is
serialized over the network.
remotehost
protected String remotehost
remoteport
protected int remoteport
objid
protected ObjID objid
commtype
protected int commtype
NinjaRemoteRef
public NinjaRemoteRef()
NinjaRemoteRef
public NinjaRemoteRef(String host,
int port,
ObjID oid,
int comm_type)
- Creates a NinjaRemoteRef which points to the object on the given
hostname and port with the given object ID. Used to manually bootstrap
a client-side reference to a remote object (that is, without going
through the registry).
- Parameters:
- host - The hostname to contact to call on this remote object.
- port - The port to contact to call on this remote object.
- oid - The ObjID corresponding to the remote object.
- comm_type - One of NinjaExportData.RMI_COMM_TYPE_* values,
specifying the communication semantics for the call.
invoke
public Object invoke(Remote obj,
Method method,
Object params[],
long opnum) throws Exception
- Invokes the given method with the given params on the remote object.
Called by the client-side stub.
newCall
public NinjaRemoteCall newCall(int opnum,
long hash) throws RemoteException
- Returns a NinjaRemoteCall, used by the stub to make method calls on the
remote object.
invoke
public void invoke(NinjaRemoteCall call) throws Exception
- Invokes the method on the remote object for the given RemoteCall. Used
by the stub.
done
public void done(NinjaRemoteCall call) throws RemoteException
- Finishes the remote method invocation. Used by the stub.
getRefClass
public String getRefClass(ObjectOutput out)
- Used to obtain the classname of the remote reference for serialization
purposes. Used by the stub.
remoteHashCode
public int remoteHashCode()
- Returns a hashcode on the remote reference. Used by the stub.
remoteEquals
public boolean remoteEquals(NinjaRemoteRef obj)
- Determines if two NinjaRemoteRef's are equal - used by the stub.
remoteToString
public String remoteToString()
- Returns a string representing this remote reference. Used by the stub.
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- writeExternal is called on the NinjaRemoteRef when the stub is
serialized over the network.
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- readExternal is called on the NinjaRemoteRef when the stub is
serialized over the network.
get_remotehost
public String get_remotehost()
- Returns the fully-qualified hostname of the machine which this
NinjaRemoteRef connects to.
get_remoteport
public int get_remoteport()
- Returns the port number of the machine which this NinjaRemoteRef
connects to. This could be a TCP or a UDP port, depending on the
value of get_commtype().
get_objid
public ObjID get_objid()
- Returns the object ID which this NinjaRemoteRef refers to. The
object ID is a unique identifier for the remote object, and is
checked on each remote method invocation to ensure that the
correct client-side stub is being used to make remote calls.
Some remote objects do not require the object ID to match.
get_commtype
public int get_commtype()
- Returns the communications type of the connection used by this
NinjaRemoteRef. The commtype fields are defined in NinjaExportData.
- See Also:
- NinjaExportData
All Packages Class Hierarchy This Package Previous Next Index