Class ContextHolderRequestHandlerAdvice

All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ExpressionCapable, NamedComponent

public class ContextHolderRequestHandlerAdvice extends AbstractRequestHandlerAdvice
An AbstractRequestHandlerAdvice implementation to store and reset a value into/from some context (e.g. ThreadLocal) against a request message. The context is populated before callback.execute() and reset after.
Adel Haidar, Artem Bilan
  • Field Details

  • Constructor Details

    • ContextHolderRequestHandlerAdvice

      public ContextHolderRequestHandlerAdvice(Function<Message<?>,Object> valueProvider, Consumer<Object> contextSetHook, Runnable contextClearHook)
      Construct an instance based on the provided hooks.
      valueProvider - The key provider function.
      contextSetHook - The context set hook consumer.
      contextClearHook - The context clear hook consumer.
  • Method Details