Package org.dspace.services.events
Class SystemEventService.EventRequestInterceptor
- java.lang.Object
-
- org.dspace.services.events.SystemEventService.EventRequestInterceptor
-
- All Implemented Interfaces:
OrderedService
,RequestInterceptor
- Enclosing class:
- SystemEventService
public final class SystemEventService.EventRequestInterceptor extends Object implements RequestInterceptor
The request interceptor for the event service. This will take care of firing queued events at the end of the request.- Author:
- Aaron Zeckoski ([email protected]) - azeckoski - 10:24:58 AM Nov 20, 2008
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.dspace.services.model.RequestInterceptor
RequestInterceptor.RequestInterruptionException
-
-
Constructor Summary
Constructors Constructor Description EventRequestInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOrder()
Sets the order to load the bean which implements this method compared to other beans of the same type.void
onEnd(String requestId, boolean succeeded, Exception failure)
Take actions after the request is handled for an operation.void
onStart(String requestId)
Take actions before the request is handled for an operation.
-
-
-
Method Detail
-
onStart
public void onStart(String requestId)
Description copied from interface:RequestInterceptor
Take actions before the request is handled for an operation. This will be called just before each request is sent to the correct request handler. For example: starting a transaction would happen at this point.If you want to interrupt the handling of this request (stop it) then throw a
RequestInterceptor.RequestInterruptionException
.- Specified by:
onStart
in interfaceRequestInterceptor
- Parameters:
requestId
- the unique id of the request
-
onEnd
public void onEnd(String requestId, boolean succeeded, Exception failure)
Description copied from interface:RequestInterceptor
Take actions after the request is handled for an operation. This will be called just before each operation is totally completed. For example: closing a transaction would happen at this point.If you want to interrupt the handling of this request (stop it) then throw a
RequestInterceptor.RequestInterruptionException
.NOTE: it is important to realize that this will be called even if the request fails. Please check the incoming success param to see if this request was successful or not. This is your cue to rollback or commit, for example.
- Specified by:
onEnd
in interfaceRequestInterceptor
- Parameters:
requestId
- the unique id of the requestsucceeded
- true if the request operations were successful, false if there was a failurefailure
- this is the exception associated with the failure, it is null if there is no associated exception
-
getOrder
public int getOrder()
Description copied from interface:OrderedService
Sets the order to load the bean which implements this method compared to other beans of the same type. Lower orders (numbers) will be loaded first (i.e. order 1 will appear before order 3 in the list). Orders do not have to be consecutive (there can be gaps). Beans with the same order or beans with no order set will be ordered randomly.- Specified by:
getOrder
in interfaceOrderedService
- Returns:
- an int which represents the loading order
-
-