|
All of the class necessary to demonstrate a simple client/server configuration are included in JavaLog. Of course, these classes can be modified or rewritten to suit the users needs. The following 3 classes implement the basic system:
$ rmiregistry & $ java grace.log.test.centralized.Server $ java grace.log.test.centralized.Receiver $ java grace.log.test.centralized.Sender
In this system, the server registers itself in the rmiregistry, then the receiver looks up this server and adds itself as a Handler on the server. This makes it so the receiver will receive all events that are sent to the server. Finally, the sender looks up the server and installs a ProxyHandler to the server. This means all events logged by the sender will be automatically sent to the server. So, an event logged by the sender is first sent by the ProxyHandler to the server and then sent back to the receiver.
The Server Distributer registers
itself in the rmiregistry under the name
log.distributer.vmid
. In fact any virtual machine
where Javlog is running will register itself under this pattern if the
-Dlog.server=true flag is set. The
vmid is the id of the virtual machine and makes the entry in
the rmiregistry unique. So, many servers in one virtual machine can
register themselves in the local registry. This makes these virtual
machines available so that another remote process can send events to
or receive events from them.