Class AbstractEventServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.events.impl.AbstractEventServiceImpl
-
- All Implemented Interfaces:
EventService
- Direct Known Subclasses:
EventServiceImpl
public abstract class AbstractEventServiceImpl extends java.lang.Object implements EventService
-
-
Field Summary
Fields Modifier and Type Field Description protected static TechnicalLoggerServicelogger
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEventServiceImpl(TechnicalLoggerService logger)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddHandler(java.lang.String eventType, SHandler<SEvent> handler)No handler duplication in a list for a given event typeprotected abstract voidaddHandlerFor(java.lang.String eventType, SHandler<SEvent> handler)protected abstract booleancontainsHandlerFor(java.lang.String type)voidfireEvent(SEvent event)Fire the given Event only to interested handlersjava.util.Set<SHandler<SEvent>>getHandlers(java.lang.String eventType)Retrieve the list of all registered Handlers or the given EventTypeprotected abstract java.util.Collection<SHandler<SEvent>>getHandlersFor(java.lang.String type)booleanhasHandlers(java.lang.String eventType, EventActionType actionType)Allows to check if an handler is listening to this event typevoidremoveAllHandlers(SHandler<SEvent> handler)Remove the given handler from the Event Service's handlers lists.protected abstract voidremoveAllHandlersFor(SHandler<SEvent> handler)voidremoveHandler(java.lang.String eventType, SHandler<SEvent> h)Remove the given handler from the given event type filterprotected abstract voidremoveHandlerFor(java.lang.String eventType, SHandler<SEvent> h)
-
-
-
Field Detail
-
logger
protected static TechnicalLoggerService logger
-
-
Constructor Detail
-
AbstractEventServiceImpl
protected AbstractEventServiceImpl(TechnicalLoggerService logger)
-
-
Method Detail
-
fireEvent
public void fireEvent(SEvent event) throws SFireEventException
Fire the given Event only to interested handlers- Specified by:
fireEventin interfaceEventService- Parameters:
event- A specific Event- Throws:
SFireEventException
-
getHandlersFor
protected abstract java.util.Collection<SHandler<SEvent>> getHandlersFor(java.lang.String type)
-
containsHandlerFor
protected abstract boolean containsHandlerFor(java.lang.String type)
-
addHandler
public final void addHandler(java.lang.String eventType, SHandler<SEvent> handler) throws HandlerRegistrationExceptionNo handler duplication in a list for a given event type- Specified by:
addHandlerin interfaceEventService- Parameters:
eventType- The type of the event the handler is interested in.handler- The handler to register in the Event Manager- Throws:
HandlerRegistrationException
-
addHandlerFor
protected abstract void addHandlerFor(java.lang.String eventType, SHandler<SEvent> handler) throws HandlerRegistrationException- Throws:
HandlerRegistrationException
-
removeAllHandlers
public final void removeAllHandlers(SHandler<SEvent> handler) throws HandlerUnregistrationException
Description copied from interface:EventServiceRemove the given handler from the Event Service's handlers lists.- Specified by:
removeAllHandlersin interfaceEventService- Parameters:
handler- The handler to remove- Throws:
HandlerUnregistrationException
-
removeHandler
public final void removeHandler(java.lang.String eventType, SHandler<SEvent> h) throws HandlerUnregistrationExceptionDescription copied from interface:EventServiceRemove the given handler from the given event type filter- Specified by:
removeHandlerin interfaceEventServiceh- The handler to remove from the given event type- Throws:
HandlerUnregistrationException
-
removeHandlerFor
protected abstract void removeHandlerFor(java.lang.String eventType, SHandler<SEvent> h) throws HandlerUnregistrationException- Parameters:
eventType-h-- Throws:
HandlerUnregistrationException
-
getHandlers
public final java.util.Set<SHandler<SEvent>> getHandlers(java.lang.String eventType)
Description copied from interface:EventServiceRetrieve the list of all registered Handlers or the given EventType- Specified by:
getHandlersin interfaceEventService
-
hasHandlers
public final boolean hasHandlers(java.lang.String eventType, EventActionType actionType)Description copied from interface:EventServiceAllows to check if an handler is listening to this event type- Specified by:
hasHandlersin interfaceEventService- Parameters:
eventType- the type of the event- Returns:
- true if an handler is interested by the event having type eventType
-
-