org.apache.camel.management
Class CompositePerformanceCounter

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

public class CompositePerformanceCounter
extends Object
implements PerformanceCounter

A composite PerformanceCounter is used for tracking performance statistics on both a per context and route level, by issuing callbacks on both when an event happens.

This implementation is used so the ManagedCamelContext can aggregate all stats from the routes.


Constructor Summary
CompositePerformanceCounter(PerformanceCounter counter1, PerformanceCounter counter2)
           
 
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 setStatisticsEnabled(boolean statisticsEnabled)
          Sets whether statistics are enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositePerformanceCounter

public CompositePerformanceCounter(PerformanceCounter counter1,
                                   PerformanceCounter counter2)
Method Detail

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


Apache CAMEL