Package org.bonitasoft.engine.events
Interface EventService
-
- All Known Implementing Classes:
AbstractEventServiceImpl,EventServiceImpl
public interface EventServiceThis is the manager of all the events triggered by other services. Handlers are registered into the Event service. When a service fire an event, it calls the right handler corresponding to the given Event.- Since:
- 6.0
- Author:
- Christophe Havard, Baptiste Mesta
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddHandler(java.lang.String eventType, SHandler<SEvent> userHandler)Add the given handler to the Event Manager's handlers list.voidfireEvent(SEvent event)Fire the specified Event to the registered handlers.java.util.Set<SHandler<SEvent>>getHandlers(java.lang.String eventType)Retrieve the list of all registered Handlers or the given EventTypebooleanhasHandlers(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.voidremoveHandler(java.lang.String eventType, SHandler<SEvent> handler)Remove the given handler from the given event type filter
-
-
-
Method Detail
-
fireEvent
void fireEvent(SEvent event) throws SFireEventException
Fire the specified Event to the registered handlers.- Parameters:
event- A specific Event- Throws:
SFireEventException
-
hasHandlers
boolean hasHandlers(java.lang.String eventType, EventActionType actionType)Allows to check if an handler is listening to this event type- Parameters:
eventType- the type of the event- Returns:
- true if an handler is interested by the event having type eventType
-
addHandler
void addHandler(java.lang.String eventType, SHandler<SEvent> userHandler) throws HandlerRegistrationExceptionAdd the given handler to the Event Manager's handlers list.- Parameters:
eventType- The type of the event the handler is interested in.userHandler- The handler to register in the Event Manager- Throws:
HandlerRegistrationException
-
removeAllHandlers
void removeAllHandlers(SHandler<SEvent> handler) throws HandlerUnregistrationException
Remove the given handler from the Event Service's handlers lists.- Parameters:
handler- The handler to remove- Throws:
HandlerUnregistrationException
-
removeHandler
void removeHandler(java.lang.String eventType, SHandler<SEvent> handler) throws HandlerUnregistrationExceptionRemove the given handler from the given event type filter- Parameters:
handler- The handler to remove from the given event type- Throws:
HandlerUnregistrationException
-
-