|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventBroker
This interface defines the methods needed to implement an EventBroker
Method Summary | |
---|---|
void |
addEventAlias(Class event)
Manually register aliases for a given event (the aliases will be determined automatically based on the class name and the event ID) |
void |
addEventAlias(Class event,
String alias)
Manually add an alias for a given event. |
void |
addEventListener(ListenerFactory factory)
register a listener id, so that events addressed to a specific listener can be delivered |
void |
addEventListener(ListenerFactory factory,
Class event)
add an event listener for a particular class of an event. |
void |
dispatchEvent(EventContext context)
Dispatch a queue of events. |
String |
getEventExtension()
Return the event extension handled by this event broker |
ListenerFactory |
getEventListener(Object id)
Get a specific listener based on listener ID |
List |
getEventListeners(Class event)
Get a List of listeners for a type of event. |
String |
matchEventClass(String eventStr)
Given a partial event class name, return the fully qualified class name if it's possible to determine. |
String |
matchListenerID(String idStr)
Given a partial id name, return the fully qualified listener ID if it's possible to determine. |
void |
purgeEventListener(ListenerFactory factory)
remove all references to an event listener, both for id and for any event classes it has registered an interest in. |
void |
removeEventListener(ListenerFactory factory)
remove a listener from general availability |
void |
removeEventListener(ListenerFactory factory,
Class event)
remove an event listener for specific types of events If the class referenced is not an instance of BaseEvent, a InvalidClassException will be thrown. |
Method Detail |
---|
String getEventExtension()
void addEventListener(ListenerFactory factory)
factory
- the listener factory to be addedvoid addEventListener(ListenerFactory factory, Class event) throws InvalidClassException
factory
- the listener factory to be addedevent
- the specific class of event for which the factory is listening
InvalidClassException
- if the event class does not implement BaseEventvoid removeEventListener(ListenerFactory factory)
factory
- the listener factory to be removedvoid removeEventListener(ListenerFactory factory, Class event) throws InvalidClassException
factory
- the listener factory to be removedevent
- the specific class of event for which the factory is listening
InvalidClassException
- if the event class does not implement BaseEventvoid purgeEventListener(ListenerFactory factory)
factory
- the listener factory to be removedvoid addEventAlias(Class event) throws InvalidClassException
event
- the specific class of event we'd like to alias
InvalidClassException
- if the event class does not implement BaseEventvoid addEventAlias(Class event, String alias) throws InvalidClassException
event
- the specific class of event we'd like to aliasalias
- the alias for this event
InvalidClassException
- if the event class does not implement BaseEventListenerFactory getEventListener(Object id)
id
- the listener id we're looking for
List getEventListeners(Class event) throws InvalidClassException
event
- the event class we are looking for
InvalidClassException
- if the event class does not implement BaseEventString matchEventClass(String eventStr) throws InvalidClassException
eventStr
- the event name alias
InvalidClassException
- if the eventStr cannot be unambiguously
matched to a class nameString matchListenerID(String idStr) throws InvalidClassException
idStr
- the id name alias
InvalidClassException
- if the idStr cannot be unambiguously
matched to a listener id namevoid dispatchEvent(EventContext context) throws EventException
Dispatch a queue of events. Generally, the queue will only contain one event, however, if you ever need to dispatch multiple events at once, the broker can handle it. All the real dispatching work is carried out by the underlying event dispatcher.
The event queue you pass in should contain several pieces of state information:
context
- the event context containing event, queue, and, sometimes, http information
EventException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |