|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.bfs.MultiEventHandler
public class MultiEventHandler
Event handler implementation that forwards a single event to multiple event handlers. This is useful since a parser only sends the event to a single handler. The event is forwarded to all registered event handlers in the order they have been registered.
Field Summary | |
---|---|
private List<EventHandler> |
handlers
|
Constructor Summary | |
---|---|
MultiEventHandler()
Create a new event handler. |
Method Summary | ||
---|---|---|
void |
addEventHandler(EventHandler e)
Adds an event handler. |
|
|
handleEvent(EventType<T> eventType,
T eventData,
BfsParser parser)
Resends the incoming event to all registered event handlers. |
|
void |
removeEventHandler(EventHandler e)
Removes an event handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private List<EventHandler> handlers
Constructor Detail |
---|
public MultiEventHandler()
addEventHandler(EventHandler)
to add the event handlers that the events should be forwarded to.
Method Detail |
---|
public void addEventHandler(EventHandler e)
public void removeEventHandler(EventHandler e)
public <T> void handleEvent(EventType<T> eventType, T eventData, BfsParser parser)
handleEvent
in interface EventHandler
eventType
- The type of event. See the parser documentation
for more information about the event types it generateseventData
- The data that is associated with the eventparser
- The parser that is resposible for parsing the file
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |