Package org.dspace.services.events
Class SystemEventService
- java.lang.Object
-
- org.dspace.services.events.SystemEventService
-
- All Implemented Interfaces:
EventService
public final class SystemEventService extends Object implements EventService
This is a placeholder until we get a real event service going. It does pretty much everything the service should do EXCEPT sending the events across a cluster.- Author:
- Aaron Zeckoski ([email protected]) - azeckoski - 4:02:31 PM Nov 19, 2008
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SystemEventService.EventRequestInterceptor
The request interceptor for the event service.
-
Constructor Summary
Constructors Constructor Description SystemEventService(RequestService requestService, CachingService cachingService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
clearQueuedEvents()
Clears all events for the current request.void
fireEvent(Event event)
Fires an event immediately (does not add it to the queue).protected int
fireQueuedEvents()
Fires all queued events for the current request.void
queueEvent(Event event)
Queues up an event to be fired at the end of a successful request/transaction.void
registerEventListener(EventListener listener)
Register an event listener which will be notified when events occur.void
shutdown()
-
-
-
Constructor Detail
-
SystemEventService
@Autowired(required=true) public SystemEventService(RequestService requestService, CachingService cachingService)
-
-
Method Detail
-
shutdown
@PreDestroy public void shutdown()
-
fireEvent
public void fireEvent(Event event)
Description copied from interface:EventService
Fires an event immediately (does not add it to the queue).- Specified by:
fireEvent
in interfaceEventService
- Parameters:
event
- contains the data related to this event
-
queueEvent
public void queueEvent(Event event)
Description copied from interface:EventService
Queues up an event to be fired at the end of a successful request/transaction.- Specified by:
queueEvent
in interfaceEventService
- Parameters:
event
- contains the data related to this event
-
registerEventListener
public void registerEventListener(EventListener listener)
Description copied from interface:EventService
Register an event listener which will be notified when events occur.- Specified by:
registerEventListener
in interfaceEventService
- Parameters:
listener
- an implementation of the event listener
-
fireQueuedEvents
protected int fireQueuedEvents()
Fires all queued events for the current request.- Returns:
- the number of events which were fired
-
clearQueuedEvents
protected int clearQueuedEvents()
Clears all events for the current request.- Returns:
- the number of events that were cleared
-
-