public abstract class AbstractEventServiceImpl extends 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(String eventType,
SHandler<SEvent> handler)
No handler duplication in a list for a given event type
|
protected abstract void |
addHandlerFor(String eventType,
SHandler<SEvent> handler) |
protected abstract boolean |
containsHandlerFor(String type) |
void |
fireEvent(SEvent event)
Fire the given Event only to interested handlers
|
Set<SHandler<SEvent>> |
getHandlers(String eventType)
Retrieve the list of all registered Handlers or the given EventType
|
protected abstract Collection<SHandler<SEvent>> |
getHandlersFor(String type) |
boolean |
hasHandlers(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(String eventType,
SHandler<SEvent> h)
Remove the given handler from the given event type filter
|
protected abstract void |
removeHandlerFor(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 Collection<SHandler<SEvent>> getHandlersFor(String type)
protected abstract boolean containsHandlerFor(String type)
public final void addHandler(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(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(String eventType, SHandler<SEvent> h) throws HandlerUnregistrationException
EventServiceremoveHandler in interface EventServiceh - The handler to remove from the given event typeHandlerUnregistrationExceptionprotected abstract void removeHandlerFor(String eventType, SHandler<SEvent> h) throws HandlerUnregistrationException
eventType - h - HandlerUnregistrationExceptionpublic final Set<SHandler<SEvent>> getHandlers(String eventType)
EventServicegetHandlers in interface EventServicepublic final boolean hasHandlers(String eventType, EventActionType actionType)
EventServicehasHandlers in interface EventServiceeventType - the type of the eventCopyright © 2018 Bonitasoft S.A.. All rights reserved.