Class EventFramework::ChainEventHandler
In: event.rb
Parent: EventHandler
WorkerThread EventDispatcher EventProcessor EventHandler NullEventHandler ChainEventHandler PrintEventHandler EventFramework EventGenerator Event EventFramework Module: EventFramework

Concrete implemention of an EventHandler that permits the chaining of EventHandlers so that an Event can be processed by more than one EventHandler. Chained handlers are processed in the order they were added to the ChainEventHandler. Furthermore, EventHandlers in the chain have the option of breaking the chain by return false from their handle_event implementation.

Methods
<<    add_event_handler    handle_event    new    to_s   
Public Class methods
new(*handlers)

Creates a ChainEventHandler with the specified handlers.

handlers
Zero or more EventHandlers that compose the chain.
Public Instance methods
add_event_handler(handler)

Adds an EventHandler to the chain. EventHandlers are processed in the order they have been added to the chain.

handler
The EventHandler to add to the chain.
This method is also aliased as <<
<<(handler)

Alias for add_event_handler

handle_event(event)

For each EventHandler in the chain, invoke the handler’s handle_event method passing it the Event to be processed. Processing of the chain stops when one of the EventHandler’s handle_event returns false. This method returns true which also permits a chain to be part of another chain.

event
The Event to process.
to_s()

Returns a string representation of the chain which includes the names of all of the EventHandlers that are part of this chain.