Spring Integration

org.springframework.integration.handler.advice
Class RequestHandlerCircuitBreakerAdvice

java.lang.Object
  extended by org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
      extended by org.springframework.integration.handler.advice.RequestHandlerCircuitBreakerAdvice
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
AbstractRequestHandlerAdvice.ExecutionCallback
 
Field Summary
 
Fields inherited from class org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
logger
 
Constructor Summary
RequestHandlerCircuitBreakerAdvice()
           
 
Method Summary
protected  java.lang.Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, java.lang.Object target, Message<?> message)
           
 void setHalfOpenAfter(long halfOpenAfter)
           
 void setThreshold(int threshold)
           
 
Methods inherited from class org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandlerCircuitBreakerAdvice

public RequestHandlerCircuitBreakerAdvice()
Method Detail

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
Specified by:
doInvoke in class AbstractRequestHandlerAdvice
Throws:
java.lang.Exception

Spring Integration