Package gnu.cajo.utils.extra
Class Registry
java.lang.Object
gnu.cajo.utils.extra.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.
- Version:
- 1.0, 11-Oct-04 Initial release
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()
This method is called by remote VMs, to request a copy of the remote object reference registry.Always a good idea; this method describes how to use the registry object, and what its features are.static void
This method is used to start up the registry server.void
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.
-
Field Details
-
entries
-
-
Constructor Details
-
Registry
public Registry()
-
-
Method Details
-
multicast
This method is called solely by this registry's Multicast member object, to register objects of remote server announcements. -
post
This method statically called by a remote machine to register an object reference.- Parameters:
ref
- The remote reference to the object to be registered- Throws:
ServerNotActiveException
-
get
This method is called by remote VMs, to request a copy of the remote object reference registry.- Returns:
- A hashtable containing all the references, keyed by their server addresses
-
getDescription
Always a good idea; this method describes how to use the registry object, and what its features are. Not unlike these comments themselves.- Returns:
- A string destribing this server object
-
main
This method is used to start up the registry server. It will announce its startup on the hailing frequency, to allow linkage to other registries, before starting to listen on it, for new announcements.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
- Parameters:
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.
-