org.qi4j.library.circuitbreaker
Class CircuitBreaker

java.lang.Object
  extended by org.qi4j.library.circuitbreaker.CircuitBreaker

public class CircuitBreaker
extends java.lang.Object

Implementation of CircuitBreaker pattern


Nested Class Summary
static class CircuitBreaker.Status
           
 
Constructor Summary
CircuitBreaker()
           
CircuitBreaker(int threshold, long timeout)
           
CircuitBreaker(int threshold, long timeout, Specification<java.lang.Throwable> allowedThrowables)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
           
 void addVetoableChangeListener(java.beans.VetoableChangeListener vcl)
           
 java.util.Date enabledOn()
           
 boolean isOn()
           
 java.lang.Throwable lastThrowable()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
           
 void removeVetoableChangeListener(java.beans.VetoableChangeListener vcl)
           
 double serviceLevel()
           
 CircuitBreaker.Status status()
           
 void success()
           
 int threshold()
           
 void throwable(java.lang.Throwable throwable)
           
 void trip()
           
 java.util.Date trippedOn()
           
 void turnOn()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CircuitBreaker

public CircuitBreaker(int threshold,
                      long timeout,
                      Specification<java.lang.Throwable> allowedThrowables)

CircuitBreaker

public CircuitBreaker(int threshold,
                      long timeout)

CircuitBreaker

public CircuitBreaker()
Method Detail

trip

public void trip()

turnOn

public void turnOn()
            throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

threshold

public int threshold()

lastThrowable

public java.lang.Throwable lastThrowable()

serviceLevel

public double serviceLevel()

status

public CircuitBreaker.Status status()

trippedOn

public java.util.Date trippedOn()

enabledOn

public java.util.Date enabledOn()

isOn

public boolean isOn()

throwable

public void throwable(java.lang.Throwable throwable)

success

public void success()

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener vcl)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener vcl)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)