|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RequestInterceptor
Executes at the beginning and/or end of system requests.
Note that the ordering of these must be set specifically higher than 0 or an exception will occur. If you do not really care what the order is you are encouraged to use 10.
Note that the highest priority interceptor will be executed first in request start and last on request end. The lowest priority interceptor would be executed last on request start and first on request end. If you need an interceptor which can execute first on request start and first on request end (or vice versa) then create 2 interceptors. :-)
| Nested Class Summary | |
|---|---|
static class |
RequestInterceptor.RequestInterruptionException
Indicate that request processing should be halted. |
| Method Summary | |
|---|---|
void |
onEnd(String requestId,
Session session,
boolean succeeded,
Exception failure)
Take actions after the request is handled for an operation. |
void |
onStart(String requestId,
Session session)
Take actions before the request is handled for an operation. |
| Methods inherited from interface org.dspace.kernel.mixins.OrderedService |
|---|
getOrder |
| Method Detail |
|---|
void onStart(String requestId,
Session session)
If you want to interrupt the handling of this request (stop it)
then throw a RequestInterceptor.RequestInterruptionException.
requestId - the unique id of the requestsession - the session associated with this request
RequestInterceptor.RequestInterruptionException - if this interceptor wants to stop the request
void onEnd(String requestId,
Session session,
boolean succeeded,
Exception failure)
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.
requestId - the unique id of the requestsession - the session associated with this 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||