INT-2698 Reference Docs for Handler Advice

INT-2698 Doc Retry Initial Commit

INT-2698 Doc Circuit Breaker

INT-2698 EERHA

INT-2698 Custom Advice

INT-2698 Polishing

INT-2698 Polishing (PR Review)
This commit is contained in:
Gary Russell
2012-08-16 15:10:14 -04:00
parent 950dc22343
commit 8d887df44f
4 changed files with 495 additions and 1 deletions

View File

@@ -23,9 +23,14 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.integration.Message;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
/**
* Base class for {@link MessageHandler} advice classes.
* Base class for {@link MessageHandler} advice classes. Subclasses should provide
* an implementation for {@link #doInvoke(ExecutionCallback, Object, Message)}.
* Used to advise the handleRequestMessage method for {@link AbstractReplyProducingMessageHandler} or
* {@link MessageHandler#handleMessage(Message)} for other message handlers.
*
* @author Gary Russell
* @since 2.2
*
@@ -70,6 +75,15 @@ public abstract class AbstractRequestHandlerAdvice implements MethodInterceptor
}
}
/**
* Subclasses implement this method to apply behavior to the {@link MessageHandler}.<p/> callback.execute()
* invokes the handler method and returns its result, or null.
* @param callback Subclasses invoke the execute() method on this interface to invoke the handler method.
* @param target The target handler.
* @param message The message that will be sent to the handler.
* @return the result after invoking the {@link MessageHandler}.
* @throws Exception
*/
protected abstract Object doInvoke(ExecutionCallback callback, Object target, Message<?> message) throws Exception;
protected interface ExecutionCallback {