org.springframework.integration.handler.advice
Class RequestHandlerCircuitBreakerAdvice
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
org.springframework.integration.handler.advice.RequestHandlerCircuitBreakerAdvice
- All Implemented Interfaces:
- org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, NamedComponent
public class RequestHandlerCircuitBreakerAdvice
- extends AbstractRequestHandlerAdvice
A circuit breaker that stops calling a failing service after threshold
failures, until halfOpenAfter milliseconds has elapsed. A successful
call resets the failure counter.
- Since:
- 2.2
- Author:
- Gary Russell
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RequestHandlerCircuitBreakerAdvice
public RequestHandlerCircuitBreakerAdvice()
setThreshold
public void setThreshold(int threshold)
setHalfOpenAfter
public void setHalfOpenAfter(long halfOpenAfter)
doInvoke
protected java.lang.Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
java.lang.Object target,
Message<?> message)
throws java.lang.Exception
- Description copied from class:
AbstractRequestHandlerAdvice
- Subclasses implement this method to apply behavior to the
MessageHandler
. callback.execute()
invokes the handler method and returns its result, or null.
- Specified by:
doInvoke
in class AbstractRequestHandlerAdvice
- Parameters:
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.
- Returns:
- the result after invoking the
MessageHandler
.
- Throws:
java.lang.Exception