ClassBus is an event delivery API written using Java (TM) 1.5. It decouples event producers from consumers.
The EventService interface is the central "bus". You can publish any kind of object to an EventService instance like this:
myEventService.publish("someChannelName", aMessageObject);Subscribers receive events from the EventService. A subscriber must implement a simple interface:
public interface EventSubscriber<T> {
void onEvent(T event);
}Subscribers attach to the bus through a combination of the channel name and event type. Subscribers can listen to particular channels by exact name match, regular expression, or any other matching strategy you can dream up. You can similarly match on event type, subtype, or some other pluggable matching strategy.
Finally, events are delivered via a DeliveryStrategy interface. Out of the box, we provide an Event Dispatch Thread strategy that ensures subscribers are notified on the EDT.