org.apache.camel.management
Class DelegatePerformanceCounter

java.lang.Object
  extended by org.apache.camel.management.DelegatePerformanceCounter
All Implemented Interfaces:
PerformanceCounter

public class DelegatePerformanceCounter
extends Object
implements PerformanceCounter

Delegates to another 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.

Version:

Constructor Summary
DelegatePerformanceCounter()
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegatePerformanceCounter

public DelegatePerformanceCounter()
Method Detail

setCounter

public void setCounter(PerformanceCounter counter)

completedExchange

public void completedExchange(Exchange exchange,
                              long time)
Description copied from interface: PerformanceCounter
Executed when an Exchange is complete.

Specified by:
completedExchange in interface PerformanceCounter
Parameters:
exchange - the exchange
time - the time it took in millis to complete

failedExchange

public void failedExchange(Exchange exchange)
Description copied from interface: PerformanceCounter
Executed when an Exchange failed.

Specified by:
failedExchange in interface PerformanceCounter
Parameters:
exchange - the exchange

isStatisticsEnabled

public boolean isStatisticsEnabled()
Description copied from interface: PerformanceCounter
Are statistics enabled?

They can be enabled and disabled at runtime

Specified by:
isStatisticsEnabled in interface PerformanceCounter
Returns:
whether statistics are enabled or not

setStatisticsEnabled

public void setStatisticsEnabled(boolean statisticsEnabled)
Description copied from interface: PerformanceCounter
Sets whether statistics are enabled.

They can be enabled and disabled at runtime

Specified by:
setStatisticsEnabled in interface PerformanceCounter
Parameters:
statisticsEnabled - whether statistics are enabled or not

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL