|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.cajo.utils.extra.Registry
public final class Registry
This class runs as a server. It allows remote VMs to register an object reference with it. Ideally, many instances of the servers would be running on the network. To keep the server memory footprint manageable, only one object is allowed per virtual machine IP address, any subsequent entries overwrite the previous. It also runs a lightwieght task, which periodically runs through the registry, purging object references that have become invalid. To encourage spontaneous internetworking, the registry will announce itself hourly, on the cajo hailing frequency, and listen on it, for other reference announcements; which it will automatically register.
Constructor Summary | |
---|---|
Registry()
|
Method Summary | |
---|---|
java.util.Hashtable |
get()
This method is called by remote VMs, to request a copy of the remote object reference registry. |
java.lang.String |
getDescription()
Always a good idea; this method describes how to use the registry object, and what its features are. |
static void |
main(java.lang.String[] args)
This method is used to start up the registry server. |
void |
multicast(Multicast multicast)
This method is called solely by this registry's Multicast member object, to register objects of remote server announcements. |
void |
post(RemoteInvoke ref)
This method statically called by a remote machine to register an object reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Registry()
Method Detail |
---|
public void multicast(Multicast multicast)
public void post(RemoteInvoke ref) throws java.rmi.server.ServerNotActiveException
ref
- The remote reference to the object to be registered
java.rmi.server.ServerNotActiveException
public java.util.Hashtable get()
public java.lang.String getDescription()
public static void main(java.lang.String[] args)
Note: to build this application, it will also require an RMI stub class for Remote. This means you must also run the following instruction:
rmic -v1.2 gnu.cajo.invoke.Remote
args
- If the server is behind a NAT router, the only argument
should be the network address used outside the router. Otherwise
provide nothing, and it will use the default local address.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |