Package org.pjdbc.jmx
Class CircuitBreakerMBeanImpl
java.lang.Object
org.pjdbc.jmx.CircuitBreakerMBeanImpl
- All Implemented Interfaces:
CircuitBreakerMBean
JMX MBean implementation that wraps a CircuitBreaker instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidForce circuit to CLOSED state.voidForce circuit to OPEN state.intGet current consecutive failure count.doubleGet failure rate as percentage (0-100).intGet failure threshold before opening circuit.getName()Get the circuit breaker name.longGet reset timeout in milliseconds (OPEN to HALF_OPEN).getState()Get current circuit breaker state: CLOSED, OPEN, or HALF_OPEN.intGet current consecutive success count (in HALF_OPEN state).intGet success threshold to close circuit from half-open.longGet total failed requests.longGet total rejected requests (circuit was open).longGet total requests processed.voidreset()Reset the circuit breaker to CLOSED state and clear all counters.
-
Constructor Details
-
CircuitBreakerMBeanImpl
-
-
Method Details
-
getState
Description copied from interface:CircuitBreakerMBeanGet current circuit breaker state: CLOSED, OPEN, or HALF_OPEN.- Specified by:
getStatein interfaceCircuitBreakerMBean
-
getName
Description copied from interface:CircuitBreakerMBeanGet the circuit breaker name.- Specified by:
getNamein interfaceCircuitBreakerMBean
-
getFailureThreshold
public int getFailureThreshold()Description copied from interface:CircuitBreakerMBeanGet failure threshold before opening circuit.- Specified by:
getFailureThresholdin interfaceCircuitBreakerMBean
-
getSuccessThreshold
public int getSuccessThreshold()Description copied from interface:CircuitBreakerMBeanGet success threshold to close circuit from half-open.- Specified by:
getSuccessThresholdin interfaceCircuitBreakerMBean
-
getResetTimeout
public long getResetTimeout()Description copied from interface:CircuitBreakerMBeanGet reset timeout in milliseconds (OPEN to HALF_OPEN).- Specified by:
getResetTimeoutin interfaceCircuitBreakerMBean
-
getFailureCount
public int getFailureCount()Description copied from interface:CircuitBreakerMBeanGet current consecutive failure count.- Specified by:
getFailureCountin interfaceCircuitBreakerMBean
-
getSuccessCount
public int getSuccessCount()Description copied from interface:CircuitBreakerMBeanGet current consecutive success count (in HALF_OPEN state).- Specified by:
getSuccessCountin interfaceCircuitBreakerMBean
-
getTotalRequests
public long getTotalRequests()Description copied from interface:CircuitBreakerMBeanGet total requests processed.- Specified by:
getTotalRequestsin interfaceCircuitBreakerMBean
-
getTotalFailures
public long getTotalFailures()Description copied from interface:CircuitBreakerMBeanGet total failed requests.- Specified by:
getTotalFailuresin interfaceCircuitBreakerMBean
-
getTotalRejections
public long getTotalRejections()Description copied from interface:CircuitBreakerMBeanGet total rejected requests (circuit was open).- Specified by:
getTotalRejectionsin interfaceCircuitBreakerMBean
-
getFailureRatePercent
public double getFailureRatePercent()Description copied from interface:CircuitBreakerMBeanGet failure rate as percentage (0-100).- Specified by:
getFailureRatePercentin interfaceCircuitBreakerMBean
-
reset
public void reset()Description copied from interface:CircuitBreakerMBeanReset the circuit breaker to CLOSED state and clear all counters.- Specified by:
resetin interfaceCircuitBreakerMBean
-
forceOpen
public void forceOpen()Description copied from interface:CircuitBreakerMBeanForce circuit to OPEN state.- Specified by:
forceOpenin interfaceCircuitBreakerMBean
-
forceClosed
public void forceClosed()Description copied from interface:CircuitBreakerMBeanForce circuit to CLOSED state.- Specified by:
forceClosedin interfaceCircuitBreakerMBean
-