| Modifier and Type | Class and Description |
|---|---|
| protected static enum | AbstractCircuitBreaker.
An internal enumeration representing the different states of a circuit breaker. |
| Modifier and Type | Field and Description |
|---|---|
| private final PropertyChangeSupport | changeSupport
An object for managing change listeners registered at this instance. |
| public static final String | PROPERTY_NAME
The name of the open property as it is passed to registered change listeners. |
| protected final AtomicReference | state
The current state of this circuit breaker. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addChangeListener(final PropertyChangeListener
the listener to be added listener)Adds a change listener to this circuit breaker. |
| protected void | changeState(final AbstractCircuitBreaker.
the new state to be set newStateChanges the internal state of this circuit breaker. |
| public abstract boolean | checkState()
Redeclares org. Checks the state of this circuit breaker and changes it if necessary. |
| public void | close()
Implements org. Closes this circuit breaker. |
| public abstract boolean | incrementAndCheckState(T increment)
Redeclares org. Increments the monitored value and performs a check of the current state of this circuit breaker. |
| public boolean | isClosed()
Implements org. Tests the current closed state of this circuit breaker. |
| protected static boolean | Returns: the boolean open flagthe state to be converted stateConverts the given state value to a boolean open property. |
| public boolean | isOpen()
Implements org. Tests the current open state of this circuit breaker. |
| public void | open()
Implements org. Opens this circuit breaker. |
| public void | removeChangeListener(final PropertyChangeListener
the listener to be removed listener)Removes the specified change listener from this circuit breaker. |
| changeSupport | back to summary |
|---|---|
| private final PropertyChangeSupport changeSupport An object for managing change listeners registered at this instance. | |
| PROPERTY_NAME | back to summary |
|---|---|
| public static final String PROPERTY_NAME The name of the open property as it is passed to registered change listeners. | |
| state | back to summary |
|---|---|
| protected final AtomicReference<AbstractCircuitBreaker. The current state of this circuit breaker. | |
| AbstractCircuitBreaker | back to summary |
|---|---|
| public AbstractCircuitBreaker() Creates an | |
| addChangeListener | back to summary |
|---|---|
| public void addChangeListener(final PropertyChangeListener listener) Adds a change listener to this circuit breaker. This listener is notified whenever the state of this circuit breaker changes. If the listener is null, it is silently ignored.
| |
| changeState | back to summary |
|---|---|
| protected void changeState(final AbstractCircuitBreaker. Changes the internal state of this circuit breaker. If there is actually a change of the state value, all registered change listeners are notified.
| |
| checkState | back to summary |
|---|---|
| public abstract boolean checkState() Redeclares org. Doc from org. Checks the state of this circuit breaker and changes it if necessary. The return value indicates whether the circuit breaker is now in state closed; a value of true typically means that the current operation can continue.
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Closes this circuit breaker. Its state is changed to closed. If this circuit breaker is already closed, this method has no effect.
| |
| incrementAndCheckState | back to summary |
|---|---|
| public abstract boolean incrementAndCheckState(T increment) Redeclares org. Doc from org. Increments the monitored value and performs a check of the current state of this
circuit breaker. This method works like
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements org. Doc from org. Tests the current closed state of this circuit breaker. A return value of true means that the circuit breaker is currently closed. This means that everything is okay with the monitored subsystem.
| |
| isOpen | back to summary |
|---|---|
| protected static boolean isOpen(final AbstractCircuitBreaker. Converts the given state value to a boolean open property.
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements org. Doc from org. Tests the current open state of this circuit breaker. A return value of true means that the circuit breaker is currently open indicating a problem in the monitored subsystem.
| |
| open | back to summary |
|---|---|
| public void open() Implements org. Doc from org. Opens this circuit breaker. Its state is changed to open. Depending on a concrete implementation, it may close itself again if the monitored subsystem becomes available. If this circuit breaker is already open, this method has no effect.
| |
| removeChangeListener | back to summary |
|---|---|
| public void removeChangeListener(final PropertyChangeListener listener) Removes the specified change listener from this circuit breaker.
| |
CircuitBreaker.
| Modifier and Type | Field and Description |
|---|---|
| public static final AbstractCircuitBreaker. | CLOSED
The closed state. |
| public static final AbstractCircuitBreaker. | OPEN
The open state. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public abstract AbstractCircuitBreaker. | |
| public static AbstractCircuitBreaker. | |
| public static AbstractCircuitBreaker. |
| CLOSED | back to summary |
|---|---|
| public static final AbstractCircuitBreaker. The closed state. | |
| OPEN | back to summary |
|---|---|
| public static final AbstractCircuitBreaker. The open state. | |
| State | back to summary |
|---|---|
| private State() | |
| oppositeState | back to summary |
|---|---|
| public abstract AbstractCircuitBreaker. Returns the opposite state to the represented state. This is useful for flipping the current state.
| |
| valueOf | back to summary |
|---|---|
| public static AbstractCircuitBreaker. | |
| values | back to summary |
|---|---|
| public static AbstractCircuitBreaker. | |