T
- the type of the value monitored by this circuit breakerpublic abstract class AbstractCircuitBreaker<T> extends java.lang.Object implements CircuitBreaker<T>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_NAME
The name of the open property as it is passed to registered
change listeners.
|
Constructor and Description |
---|
AbstractCircuitBreaker()
Creates an
AbstractCircuitBreaker . |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(java.beans.PropertyChangeListener listener)
Adds a change listener to this circuit breaker.
|
abstract boolean |
checkState()
Checks the state of this circuit breaker and changes it if necessary.
|
void |
close()
Closes this circuit breaker.
|
abstract boolean |
incrementAndCheckState(T increment)
Increments the monitored value and performs a check of the current state of this
circuit breaker.
|
boolean |
isClosed()
Returns the current closed state of this circuit breaker.
|
boolean |
isOpen()
Returns the current open state of this circuit breaker.
|
void |
open()
Opens this circuit breaker.
|
void |
removeChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified change listener from this circuit breaker.
|
public static final java.lang.String PROPERTY_NAME
public AbstractCircuitBreaker()
AbstractCircuitBreaker
. It also creates an internal PropertyChangeSupport
.public boolean isOpen()
isOpen
in interface CircuitBreaker<T>
public boolean isClosed()
isClosed
in interface CircuitBreaker<T>
public abstract boolean checkState()
CLOSED
; a value
of true typically means that the current operation can continue.checkState
in interface CircuitBreaker<T>
public abstract boolean incrementAndCheckState(T increment)
CircuitBreaker.checkState()
, but the monitored
value is incremented before the state check is performed.incrementAndCheckState
in interface CircuitBreaker<T>
increment
- value to increment in the monitored value of the circuit breakerpublic void close()
close
in interface CircuitBreaker<T>
public void open()
open
in interface CircuitBreaker<T>
public void addChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener to be addedpublic void removeChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener to be removed"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"