Modifier and Type | Method and Description |
---|---|
default R |
CircuitBreaker.execute(Task<R> task,
BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler)
Executes the given
Callable only when given BreakStrategy allows the execution at the time of call. |
<U> R |
CircuitBreaker.execute(Task<R> task,
BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler,
U userData)
Executes the given
Callable only when given BreakStrategy allows the execution at the time of call. |
R |
ContextAwareCircuitBreaker.executeInContext(Task<R> task,
BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler,
ExecutionContext<R> executionContext)
Executes given task within given execution context.
|
Modifier and Type | Method and Description |
---|---|
ReusableCircuitBreakerBuilder<R> |
ReusableCircuitBreakerBuilder.withBreakHandler(BreakHandler<R> breakHandler) |
Modifier and Type | Method and Description |
---|---|
<U> R |
AbstractCircuitBreaker.execute(Task<R> task,
BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler,
U userData) |
R |
AbstractCircuitBreaker.executeInContext(Task<R> task,
BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler,
ExecutionContext<R> executionContext) |
Constructor and Description |
---|
ReusableCircuitBreaker(BreakStrategy<R> breakStrategy,
BreakHandler<R> breakHandler)
Constructs new breaker with given break strategy and break handler.
|
Modifier and Type | Interface and Description |
---|---|
interface |
BreakHandlerFactory<R>
This is generic factory method interface.
|
interface |
OnePerExecutionHandlerFactory<R>
An implementation of
BreakHandlerFactory which creates new instance of given BreakHandler if it
does not exist in current execution context, otherwise returns BreakHandler bound to current execution
context (reuses the same instance for handling subsequent calls to
onBreak(ContextAwareCircuitBreaker, Task, BreakStrategy, ExecutionContext) ). |
Modifier and Type | Method and Description |
---|---|
BreakHandler<R> |
OnePerExecutionHandlerFactory.createNewHandler(Task<R> task,
ExecutionContext<R> executionContext)
Constructs and returns new
BreakHandler . |
default BreakHandler<R> |
OnePerExecutionHandlerFactory.makeHandler(Task<R> task,
ExecutionContext<R> executionContext) |
BreakHandler<R> |
BreakHandlerFactory.makeHandler(Task<R> task,
ExecutionContext<R> executionContext)
Returns an instance of
BreakHandler which should be used to handle the break. |
Modifier and Type | Method and Description |
---|---|
static <R,P> BreakHandler<R> |
InstantiationHelper.constructSingleParamInstance(Class<? extends BreakHandler> handlerClass,
P constructorParam)
Creates new instances of given
BreakHandler class. |
Modifier and Type | Method and Description |
---|---|
static <R,P> BreakHandler<R> |
InstantiationHelper.constructSingleParamInstance(Class<? extends BreakHandler> handlerClass,
P constructorParam)
Creates new instances of given
BreakHandler class. |
Modifier and Type | Class and Description |
---|---|
class |
ExceptionThrowingHandler<R>
The handler that throws custom exception in case "break" occurs.
|
class |
NoActionHandler<R>
An implementation of
BreakHandler that does completely nothing. |
class |
ReturnStaticValueHandler<R>
An implementation of
BreakHandler that always returns the value given as a parameter. |
class |
ReusableRetryHandler<R>
An implementation of
BreakHandler which creates single instance of StatefulRetryHandler per
execution context. |
class |
SimpleHandlerFactory<R>
An implementation of
BreakHandlerFactory which creates new instance of given BreakHandler class for
each invocation of SimpleHandlerFactory.makeHandler(Task, ExecutionContext) . |
class |
StatefulRetryHandler<R>
An implementation of
BreakHandler that retries to execute given Task again. |
Modifier and Type | Method and Description |
---|---|
BreakHandler<R> |
ReusableRetryHandler.createNewHandler(Task<R> task,
ExecutionContext<R> executionContext) |
BreakHandler<R> |
SimpleHandlerFactory.makeHandler(Task<R> task,
ExecutionContext<R> executionContext) |
Constructor and Description |
---|
SimpleHandlerFactory(Class<? extends BreakHandler<R>> handlerClass) |
Copyright © 2017. All rights reserved.