public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupport implements MethodInterceptor
MessageHandler
advice classes. Subclasses should provide an
implementation for doInvoke(ExecutionCallback, Object, Message)
. Used to
advise the handleRequestMessage method for
AbstractReplyProducingMessageHandler
or
MessageHandler.handleMessage(Message)
for other message handlers.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractRequestHandlerAdvice.ExecutionCallback
Called by subclasses in doInvoke() to proceed() the invocation.
|
protected static class |
AbstractRequestHandlerAdvice.ThrowableHolderException |
EXPRESSION_PARSER, logger
Constructor and Description |
---|
AbstractRequestHandlerAdvice() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
Object target,
Message<?> message)
Subclasses implement this method to apply behavior to the
MessageHandler . |
Object |
invoke(MethodInvocation invocation) |
protected Exception |
unwrapExceptionIfNecessary(Exception e)
Unwrap the cause of a
AbstractRequestHandlerAdvice.ThrowableHolderException . |
protected Throwable |
unwrapThrowableIfNecessary(Exception e)
Unwrap the cause of a
AbstractRequestHandlerAdvice.ThrowableHolderException . |
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
public final Object invoke(MethodInvocation invocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable
protected abstract Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message)
MessageHandler
.
callback.execute() invokes the handler method and returns its result, or null.
callback
- Subclasses invoke the execute() method on this interface to invoke the handler method.target
- The target handler.message
- The message that will be sent to the handler.MessageHandler
.protected Exception unwrapExceptionIfNecessary(Exception e)
AbstractRequestHandlerAdvice.ThrowableHolderException
.e
- The exception.AbstractRequestHandlerAdvice.ThrowableHolderException
protected Throwable unwrapThrowableIfNecessary(Exception e)
AbstractRequestHandlerAdvice.ThrowableHolderException
.e
- The exception.AbstractRequestHandlerAdvice.ThrowableHolderException