public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupport implements org.aopalliance.intercept.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.
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
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(org.aopalliance.intercept.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, getApplicationContextId, getBeanFactory, getComponentName, getComponentType, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public final Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
Throwable
protected abstract Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message) throws Exception
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
.Exception
- Any Exception.protected Exception unwrapExceptionIfNecessary(Exception e)
AbstractRequestHandlerAdvice.ThrowableHolderException
.e
- The exception.AbstractRequestHandlerAdvice.ThrowableHolderException