uka.karmi.rmi.server
Class UnicastRemoteServerRef

java.lang.Object
  extended byuka.karmi.rmi.server.RemoteServerRef
      extended byuka.karmi.rmi.server.UnicastRemoteServerRef

public class UnicastRemoteServerRef
extends RemoteServerRef

UnicastRemoteServerRef is a remote server reference for unicast remote objects.

Author:
Christian Nester, Bernhard Haumacher

Field Summary
 Remote object
          The exported object.
private  RemoteSkeleton skeleton
          A skeleton object for the local side.
private  RemoteStub stub
          A stub object for this remote object.
 
Fields inherited from class uka.karmi.rmi.server.RemoteServerRef
callCounter, ep, objectId, objectId2
 
Constructor Summary
UnicastRemoteServerRef(Remote object, int exportId, int objectId)
           
 
Method Summary
static RemoteSkeleton createProxySkeletonFor(RemoteStub stub)
           
 void doApplicationCall(ServerConnection c)
          Method dispatch for unicast remote servers.
 RemoteStub getStub()
          Returns a stub object for the remote object connected to this object.
 int hashCode()
           
 boolean remoteEquals(RemoteStub obj)
          Determines if a stub object references this server object.
 void synchronize(RMACallback cb)
           
 java.lang.String toStringMembers()
           
 void unreferenced()
          Called whenever the last remote reference to this server implementation is garbage collected.
 
Methods inherited from class uka.karmi.rmi.server.RemoteServerRef
createSkeletonFor, createStubFor, decCallCounter, getClientHost, incCallCounter, newInstanceRelative, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

stub

private transient RemoteStub stub
A stub object for this remote object. If this objects moves to some other host, the stub is invalid afterwards.


skeleton

private RemoteSkeleton skeleton
A skeleton object for the local side. After deserialisation, the skeleton might still be valid, so it is not transient.


object

public Remote object
The exported object.

Constructor Detail

UnicastRemoteServerRef

public UnicastRemoteServerRef(Remote object,
                              int exportId,
                              int objectId)
                       throws RemoteException
Method Detail

hashCode

public int hashCode()

remoteEquals

public boolean remoteEquals(RemoteStub obj)
Description copied from class: RemoteServerRef
Determines if a stub object references this server object.

Specified by:
remoteEquals in class RemoteServerRef

createProxySkeletonFor

public static RemoteSkeleton createProxySkeletonFor(RemoteStub stub)
                                             throws RemoteException
Throws:
RemoteException

doApplicationCall

public void doApplicationCall(ServerConnection c)
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException

Method dispatch for unicast remote servers. This methods simply forwards all arguments to the doApplicationCall() method of the single skeleton object associated with this remote server reference.

Specified by:
doApplicationCall in class RemoteServerRef
Parameters:
c - the connection, the call came in
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
RemoteServerRef.doApplicationCall(ServerConnection), RemoteSkeleton.doApplicationCall(ServerConnection)

unreferenced

public void unreferenced()
Description copied from class: RemoteServerRef
Called whenever the last remote reference to this server implementation is garbage collected.

Specified by:
unreferenced in class RemoteServerRef
See Also:
RemoteServerRef.unreferenced()

getStub

public RemoteStub getStub()
Returns a stub object for the remote object connected to this object.

Specified by:
getStub in class RemoteServerRef

synchronize

public void synchronize(RMACallback cb)
                 throws java.lang.Throwable
Specified by:
synchronize in class RemoteServerRef
Throws:
java.lang.Throwable

toStringMembers

public java.lang.String toStringMembers()
Overrides:
toStringMembers in class RemoteServerRef