public class DelegatePerformanceCounter extends Object implements PerformanceCounter
PerformanceCounter
.
This is used to allow Camel to pre initialize these delegate performance counters
when Camel creates the actual route from the model. Then later as the various
processors, routes etc. is created and registered in the LifecycleStrategy
then we link this to the real ManagedPerformanceCounter
mbean
so the mbean can gather statistics.
This delegation is needed as how Camel is designed to register services in the
LifecycleStrategy
in various stages.Constructor and Description |
---|
DelegatePerformanceCounter() |
Modifier and Type | Method and Description |
---|---|
void |
completedExchange(Exchange exchange,
long time)
Executed when an
Exchange is complete. |
void |
failedExchange(Exchange exchange)
Executed when an
Exchange failed. |
boolean |
isStatisticsEnabled()
Are statistics enabled?
They can be enabled and disabled at runtime
|
void |
setCounter(PerformanceCounter counter) |
void |
setStatisticsEnabled(boolean statisticsEnabled)
Sets whether statistics are enabled.
|
String |
toString() |
public DelegatePerformanceCounter()
public void setCounter(PerformanceCounter counter)
public void completedExchange(Exchange exchange, long time)
PerformanceCounter
Exchange
is complete.completedExchange
in interface PerformanceCounter
exchange
- the exchangetime
- the time it took in millis to completepublic void failedExchange(Exchange exchange)
PerformanceCounter
Exchange
failed.failedExchange
in interface PerformanceCounter
exchange
- the exchangepublic boolean isStatisticsEnabled()
PerformanceCounter
isStatisticsEnabled
in interface PerformanceCounter
public void setStatisticsEnabled(boolean statisticsEnabled)
PerformanceCounter
setStatisticsEnabled
in interface PerformanceCounter
statisticsEnabled
- whether statistics are enabled or notApache Camel