Class SinglePhaseInterceptor
java.lang.Object
org.distributeme.core.interceptor.AbstractRequestInterceptor
org.distributeme.core.interceptor.SinglePhaseInterceptor
- All Implemented Interfaces:
ClientSideRequestInterceptor,ServerSideRequestInterceptor
This interceptor can be configured to use one or multiple phases, but doesn't need to support all phases.
- Version:
- $Id: $Id
- Author:
- lrosenberg
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSinglePhaseInterceptor(InterceptionPhase atLeastOne, InterceptionPhase... phases) Constructor for SinglePhaseInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionfinal InterceptorResponseafterServantCall(ServerSideCallContext context, InterceptionContext iContext) Called after the service actually processed the request.final InterceptorResponseafterServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called immediately after service call, but before anything is returned to the caller.final InterceptorResponsebeforeServantCall(ServerSideCallContext context, InterceptionContext iContext) Called before any real processing happens on the server side.final InterceptorResponsebeforeServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called after client side processing but before the actual call is performed.protected abstract InterceptorResponseprocessPhase(AbstractCallContext callContext, InterceptionContext iContext) processPhase.
-
Constructor Details
-
SinglePhaseInterceptor
Constructor for SinglePhaseInterceptor.
- Parameters:
atLeastOne- aInterceptionPhaseobject.phases- aInterceptionPhaseobject.
-
-
Method Details
-
beforeServantCall
public final InterceptorResponse beforeServantCall(ServerSideCallContext context, InterceptionContext iContext) Called before any real processing happens on the server side.- Specified by:
beforeServantCallin interfaceServerSideRequestInterceptor- Overrides:
beforeServantCallin classAbstractRequestInterceptor- Parameters:
context- aServerSideCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-
afterServantCall
public final InterceptorResponse afterServantCall(ServerSideCallContext context, InterceptionContext iContext) Called after the service actually processed the request. Allows to inspect or modify the answer.- Specified by:
afterServantCallin interfaceServerSideRequestInterceptor- Overrides:
afterServantCallin classAbstractRequestInterceptor- Parameters:
context- aServerSideCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-
beforeServiceCall
public final InterceptorResponse beforeServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called after client side processing but before the actual call is performed.- Specified by:
beforeServiceCallin interfaceClientSideRequestInterceptor- Overrides:
beforeServiceCallin classAbstractRequestInterceptor- Parameters:
context- aClientSideCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-
afterServiceCall
public final InterceptorResponse afterServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called immediately after service call, but before anything is returned to the caller. This interceptor can be used to inspect or modify the answer from server.- Specified by:
afterServiceCallin interfaceClientSideRequestInterceptor- Overrides:
afterServiceCallin classAbstractRequestInterceptor- Parameters:
context- aClientSideCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-
processPhase
protected abstract InterceptorResponse processPhase(AbstractCallContext callContext, InterceptionContext iContext) processPhase.
- Parameters:
callContext- aAbstractCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-