Package net.groboclown.eventbus.v2

The eventbus package allows for a dynamic application to distribute application events in an infinitely extensible way.

See:
          Description

Interface Summary
IEventBusFilterAgent An interface which contains the logic for filtering which event object may be passed to the corresponding EventBusListener which registered the filter.
IEventBusListener An interface for processing events.
IEventDistributor An interface for distributing events to any listeners.
 

Class Summary
EventBus Master control unit which is in charge of registering event listeners, deregistering event listeners, and distributing events.
EventBusEvent The event object which is passed around.
EventBusEventObject The EventBusEvent data object used by EventBus events.
EventBusId Contains unique references to both the EventBus, and the local object.
LocalEventDistributor The default distributor - sends events asynchronously in the current thread to all listeners.
ThreadedLocalEventDistributor Sends events asynchronously in a separate event thread to all local listeners.
 

Exception Summary
RemoteListenerException This exception is thrown by Distributors when they find a Listener that throws a RemoteException.
 

Package net.groboclown.eventbus.v2 Description

The eventbus package allows for a dynamic application to distribute application events in an infinitely extensible way.

All parts of the application which need to tie into the system must register themselves to the eventbus manager, requesting to listen to various events.

When an event is posted, all listeners will receive the event. There is no guarantee as to the order, or as to which thread the event will be sent in. Indeed, there is no guarantee to a synchronized execution of event listeners.

Architecture

The EventBus is a de-centralized warehouse which knows how to move events from event source to event listeners. In a distributed system, each local instance will have its own EventBus, which will send event messages between local listeners, and will send them along the wire to all known external EventBuses.

In order to send an Event, an event sender must be registered as an EventBusSource. Any listeners this source registers will be associated with the source object. It is the source object that is passed with the events, to allow for lightweight data passing across the wire.

An object may register EventBusListeners to the EventBus. Listeners are announced of events, and are allowed to process the events. Listeners also have EventBusFilterAgents, which filter events for its listener. These agents may be passed across the wire in a distributed environment.

Extendable

The system is exendable - any kind of event distribution system can be added. By default, a local distribution system is loaded. However, any additional systems may be "plugged" into the bus via the IEventDistributor interface.

Eventually, the package should be extended to allow for the events to be distributed over a network. The application would need to define in the Java environment (i.e. -D command-line options) whether it is a server or client, and the listen-to and connect-to ports (and server name for the client).

Usage

  1. TBD



Written under the LGPL