org.qi4j.library.circuitbreaker
Class CircuitBreaker

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

public class CircuitBreaker
extends 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<Throwable> allowedThrowables)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener pcl)
           
 void addVetoableChangeListener(VetoableChangeListener vcl)
           
 Date getEnableOn()
           
 Throwable getLastThrowable()
           
 double getServiceLevel()
           
 CircuitBreaker.Status getStatus()
           
 int getThreshold()
           
 Date getTrippedOn()
           
 boolean isOn()
           
 void removePropertyChangeListener(PropertyChangeListener pcl)
           
 void removeVetoableChangeListener(VetoableChangeListener vcl)
           
 void success()
           
 void throwable(Throwable throwable)
           
 void trip()
           
 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<Throwable> allowedThrowables)

CircuitBreaker

public CircuitBreaker(int threshold,
                      long timeout)

CircuitBreaker

public CircuitBreaker()
Method Detail

trip

public void trip()

turnOn

public void turnOn()
            throws PropertyVetoException
Throws:
PropertyVetoException

getThreshold

public int getThreshold()

getLastThrowable

public Throwable getLastThrowable()

getServiceLevel

public double getServiceLevel()

getStatus

public CircuitBreaker.Status getStatus()

getTrippedOn

public Date getTrippedOn()

getEnableOn

public Date getEnableOn()

isOn

public boolean isOn()

throwable

public void throwable(Throwable throwable)

success

public void success()

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener vcl)

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener vcl)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener pcl)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener pcl)