public abstract class AbstractEventServiceImpl extends java.lang.Object implements EventService
| Modifier and Type | Field and Description |
|---|---|
protected static TechnicalLoggerService |
logger |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEventServiceImpl(TechnicalLoggerService logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(java.lang.String eventType,
SHandler<SEvent> handler)
No handler duplication in a list for a given event type
|
protected abstract void |
addHandlerFor(java.lang.String eventType,
SHandler<SEvent> handler) |
protected abstract boolean |
containsHandlerFor(java.lang.String type) |
void |
fireEvent(SEvent event)
Fire the given Event only to interested handlers
|
java.util.Set<SHandler<SEvent>> |
getHandlers(java.lang.String eventType)
Retrieve the list of all registered Handlers or the given EventType
|
protected abstract java.util.Collection<SHandler<SEvent>> |
getHandlersFor(java.lang.String type) |
boolean |
hasHandlers(java.lang.String eventType,
EventActionType actionType)
Allows to check if an handler is listening to this event type
|
void |
removeAllHandlers(SHandler<SEvent> handler)
Remove the given handler from the Event Service's handlers lists.
|
protected abstract void |
removeAllHandlersFor(SHandler<SEvent> handler) |
void |
removeHandler(java.lang.String eventType,
SHandler<SEvent> h)
Remove the given handler from the given event type filter
|
protected abstract void |
removeHandlerFor(java.lang.String eventType,
SHandler<SEvent> h) |
protected static TechnicalLoggerService logger
protected AbstractEventServiceImpl(TechnicalLoggerService logger)
public void fireEvent(SEvent event) throws SFireEventException
fireEvent in interface EventServiceevent - A specific EventSFireEventExceptionprotected abstract java.util.Collection<SHandler<SEvent>> getHandlersFor(java.lang.String type)
protected abstract boolean containsHandlerFor(java.lang.String type)
public final void addHandler(java.lang.String eventType,
SHandler<SEvent> handler)
throws HandlerRegistrationException
addHandler in interface EventServiceeventType - The type of the event the handler is interested in.handler - The handler to register in the Event ManagerHandlerRegistrationExceptionprotected abstract void addHandlerFor(java.lang.String eventType,
SHandler<SEvent> handler)
throws HandlerRegistrationException
HandlerRegistrationExceptionpublic final void removeAllHandlers(SHandler<SEvent> handler) throws HandlerUnregistrationException
EventServiceremoveAllHandlers in interface EventServicehandler - The handler to removeHandlerUnregistrationExceptionpublic final void removeHandler(java.lang.String eventType,
SHandler<SEvent> h)
throws HandlerUnregistrationException
EventServiceremoveHandler in interface EventServiceh - The handler to remove from the given event typeHandlerUnregistrationExceptionprotected abstract void removeHandlerFor(java.lang.String eventType,
SHandler<SEvent> h)
throws HandlerUnregistrationException
eventType - h - HandlerUnregistrationExceptionpublic final java.util.Set<SHandler<SEvent>> getHandlers(java.lang.String eventType)
EventServicegetHandlers in interface EventServicepublic final boolean hasHandlers(java.lang.String eventType,
EventActionType actionType)
EventServicehasHandlers in interface EventServiceeventType - the type of the event