Parsing Engine

Package danbikel.switchboard

Provides classes to implement a distributed client-server environment, with a central switchboard responsible for assigning clients to servers and for doling out objects to clients for processing.

See:
          Description

Interface Summary
Client A semantic marker for SwitchboardUser implementors that are clients; also, specifies client-specific methods for the switchboard to use.
Consumer Specification for a consumer of objects that have already been processed by switchboard clients, allowing arbitrary post-processing in a distributed object-processing run involving a switchboard.
ObjectReader Specifies methods for reading objects from an underlying Reader or InputStream object.
ObjectReaderFactory A specification for constructing ObjectReader instances.
ObjectWriter Specifies methods for writing objects to an unerlying Writer or OutputStream object.
ObjectWriterFactory A specification for constructing ObjectWriter instances.
Server A semantic marker for those switchboard users that are servers; also, specifies server-specific methods for the switchboard to use.
SwitchboardRemote The methods by which both clients and servers register with a single RMI-accessible Switchboard object.
SwitchboardUser An interface that both types of users of the switchboard (clients and servers) must implement, providing useful information about the switchboard user, as well as a means to determine whether the switchboard user is alive and to tell it when it is allowed to die.
 

Class Summary
AbstractClient Provides a convenient default implementation of the Client interface, as well as other convenient utility methods.
AbstractServer Provides a convenient default implementation of the Server interface, allowing subclasses to focus solely on the services they will provide to clients.
AbstractSwitchboardUser Provides a convenient default implementation of the interface SwitchboardUser, so that subclasses that need to implement the Client and Server interfaces need only implement the methods introduced in those subinterfaces, as is the case with the AbstractClient and AbstractServer implementations provided by this package.
AbstractSwitchboardUser.SBUserRetry Provides an appropriate overridden definition of Retry.keepTrying() that checks the value of AbstractSwitchboardUser.timeToDie.
Failover An RMI invocation handler that gets a new server for switchboard clients in the event of a method invocation failure.
NumberedObject A class to bundle an object with an integer that represents the order in which the object was discovered in its input file or stream (the object's number), as well as a flag to indicate whether the object has been processed.
Switchboard The switchboard serves as the central "hub" in a distributed RMI object-processing run, accepting registrations of clients and servers, and assigning clients to servers.
TextObjectWriter A simple ObjectWriter that merely prints out objects' string representations (as determined by their toString methods) to an underlying character stream (Writer) followed by a newline.
TextObjectWriterFactory A factory for returning TextObjectWriter objects.
 

Exception Summary
RegistrationException An exception raised when a switchboard user cannot be registered properly with the switchboard.
UnrecognizedClientException An exception raised when a switchboard method with a client ID parameter is called with an invalid client ID.
UnrecognizedServerException An exception raised when a switchboard method that has a server ID parameter is called with an invalid server ID.
 

Package danbikel.switchboard Description

Provides classes to implement a distributed client-server environment, with a central switchboard responsible for assigning clients to servers and for doling out objects to clients for processing. The switchboard obtains objects for processing from one or more input files. When clients finish processing an object, they return it to the switchboard, and when all the objects of an input file have been processed, the switchboard assembles them in the order in which they appeared in the input file and outputs them to an output file.

The distributed system implemented by this package is fault tolerant, in that any client or server can fail, and the rest of the system will recover gracefully. If a client fails in the middle of processing an object, the switchboard pushes the unprocessed object onto an internal stack, so that another client may processs it. If a server fails, clients will be notified to request a new server. If the switchboard itself fails, a new switchboard may be brought up and effectively recover the same state at the time of the crash, without having to restart clients and servers.


Parsing Engine

Author: Dan Bikel.