public interface CircuitBreaker
Modifier and Type | Method and Description |
---|---|
boolean |
canRequest()
Decides whether a request should be sent or failed depending on the current circuit state.
|
String |
name()
Returns the name of the circuit breaker.
|
static CircuitBreaker |
of(String name)
Creates a new
CircuitBreaker that has the specified name and the default configurations. |
static CircuitBreaker |
ofDefaultName()
Creates a new
CircuitBreaker that has a default name and the default configurations. |
void |
onFailure()
Reports a remote invocation failure.
|
void |
onFailure(Throwable cause)
Reports a remote invocation failure with the reason.
|
void |
onSuccess()
Reports a remote invocation success.
|
static CircuitBreaker of(String name)
CircuitBreaker
that has the specified name and the default configurations.name
- The name of the circuit breaker.static CircuitBreaker ofDefaultName()
CircuitBreaker
that has a default name and the default configurations.String name()
void onSuccess()
void onFailure(Throwable cause)
cause
- The cause of failure.void onFailure()
boolean canRequest()
Copyright © 2015-2016 LINE Corporation. All Rights Reserved.