Package org.chenile.core.context
Class PopulateContextContainer
java.lang.Object
org.chenile.core.interceptors.BaseChenileInterceptor
org.chenile.core.context.PopulateContextContainer
- All Implemented Interfaces:
HeaderCopier,Command<ChenileExchange>
This class can act as a
HeaderCopier-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(ChenileExchange exchange) protected voiddoPostProcessing(ChenileExchange exchange) Override this to do post processing.protected voiddoPreProcessing(ChenileExchange exchange) Override this to do pre-processing.static voidpopulateChenileExchangeFromContext(ChenileExchange exchange, ContextContainer contextContainer) static voidpopulateContextFromChenileExchange(ChenileExchange exchange, ContextContainer contextContainer) Methods inherited from class org.chenile.core.interceptors.BaseChenileInterceptor
bypassInterception, doContinue, execute, getExtensionByAnnotation, getExtensionByAnnotation, resumeFromSavedPoint, savePoint
-
Field Details
-
contextContainer
-
-
Constructor Details
-
PopulateContextContainer
public PopulateContextContainer()
-
-
Method Details
-
doPreProcessing
Description copied from class:BaseChenileInterceptorOverride this to do pre-processing. This will be called before the service is invoked. Don't expect to see exception or response being set inChenileExchange. However you can check forChenileExchange.getBody()to manipulate the body if this interceptor is a Chenile post processor or a service specific or operation specific interceptor.
If this interceptor is a Chenile pre-processor, thenChenileExchange.getBody()will return null. Then you need to look at headers only.- Overrides:
doPreProcessingin classBaseChenileInterceptor
-
doPostProcessing
Description copied from class:BaseChenileInterceptorOverride this to do post processing. This will be called even if there is an exception downstream. So make sure that if you don't want to do any processing in case of exception, check ifChenileExchange.getException()returns null value. If you happen to throw an exception in this method, it will get added to the set of errors that would ultimately be returned. See alsoChenileExchange.setException(Throwable)- Overrides:
doPostProcessingin classBaseChenileInterceptor- Parameters:
exchange- Chenile Exchange
-
populateContextFromChenileExchange
public static void populateContextFromChenileExchange(ChenileExchange exchange, ContextContainer contextContainer) -
populateChenileExchangeFromContext
public static void populateChenileExchangeFromContext(ChenileExchange exchange, ContextContainer contextContainer) -
copy
- Specified by:
copyin interfaceHeaderCopier
-