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 |
EXPRESSION_PARSER
Constructor and Description |
---|
AbstractRequestHandlerAdvice() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
java.lang.Object target,
org.springframework.messaging.Message<?> message)
Subclasses implement this method to apply behavior to the
MessageHandler . |
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
protected java.lang.Exception |
unwrapExceptionIfNecessary(java.lang.Exception e)
Unwrap the cause of a
AbstractRequestHandlerAdvice.ThrowableHolderException . |
protected java.lang.Throwable |
unwrapThrowableIfNecessary(java.lang.Exception e)
Unwrap the cause of a
AbstractRequestHandlerAdvice.ThrowableHolderException . |
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
public final java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
java.lang.Throwable
protected abstract java.lang.Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, java.lang.Object target, org.springframework.messaging.Message<?> message) throws java.lang.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
.java.lang.Exception
- Any Exception.protected java.lang.Exception unwrapExceptionIfNecessary(java.lang.Exception e)
AbstractRequestHandlerAdvice.ThrowableHolderException
.e
- The exception.AbstractRequestHandlerAdvice.ThrowableHolderException
protected java.lang.Throwable unwrapThrowableIfNecessary(java.lang.Exception e)
AbstractRequestHandlerAdvice.ThrowableHolderException
.e
- The exception.AbstractRequestHandlerAdvice.ThrowableHolderException