Package org.bonitasoft.engine.events
Interface EventService
- All Known Implementing Classes:
AbstractEventServiceImpl,EventServiceImpl
public interface EventService
This 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
Modifier and TypeMethodDescriptionvoidaddHandler(String eventType, SHandler<SEvent> userHandler) Add the given handler to the Event Manager's handlers list.voidFire the specified Event to the registered handlers.getHandlers(String eventType) Retrieve the list of all registered Handlers or the given EventTypebooleanhasHandlers(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(String eventType, SHandler<SEvent> handler) Remove the given handler from the given event type filter
-
Method Details
-
fireEvent
Fire the specified Event to the registered handlers.- Parameters:
event- A specific Event- Throws:
SFireEventException
-
hasHandlers
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
Add 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
Remove the given handler from the Event Service's handlers lists.- Parameters:
handler- The handler to remove- Throws:
HandlerUnregistrationException
-
removeHandler
void removeHandler(String eventType, SHandler<SEvent> handler) throws HandlerUnregistrationException Remove the given handler from the given event type filter- Parameters:
handler- The handler to remove from the given event type- Throws:
HandlerUnregistrationException
-
getHandlers
Retrieve the list of all registered Handlers or the given EventType
-