public class CircuitBreakerLoadBalancer extends LoadBalancerSupport implements Traceable, CamelContextAware
log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
CircuitBreakerLoadBalancer() |
CircuitBreakerLoadBalancer(List<Class<?>> exceptions) |
Modifier and Type | Method and Description |
---|---|
CamelContext |
getCamelContext()
Get the
CamelContext |
List<Class<?>> |
getExceptions() |
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled.
|
protected boolean |
hasFailed(Exchange exchange) |
boolean |
isRunAllowed()
Helper methods so the service knows if it should keep running.
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange.
|
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setHalfOpenAfter(long halfOpenAfter) |
void |
setThreshold(int threshold) |
String |
toString() |
addProcessor, doShutdown, doStart, doStop, getProcessors, hasNext, next, process, removeProcessor
doResume, doSuspend, getStatus, getVersion, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public CircuitBreakerLoadBalancer(List<Class<?>> exceptions)
public CircuitBreakerLoadBalancer()
public void setHalfOpenAfter(long halfOpenAfter)
public void setThreshold(int threshold)
public CamelContext getCamelContext()
CamelContextAware
CamelContext
getCamelContext
in interface CamelContextAware
public void setCamelContext(CamelContext camelContext)
CamelContextAware
CamelContext
setCamelContext
in interface CamelContextAware
camelContext
- the Camel contextpublic List<Class<?>> getExceptions()
public boolean isRunAllowed()
StatefulService
isRunAllowed
in interface StatefulService
isRunAllowed
in class ServiceSupport
public boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessor
Processor.process(org.apache.camel.Exchange)
, but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception
would be set on the Exchange
.process
in interface AsyncProcessor
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.public String getTraceLabel()
Traceable
getTraceLabel
in interface Traceable
Apache Camel