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:
$Revision: 823448 $

Constructor Summary
DelegatePerformanceCounter()
           
 
Method Summary
 void completedExchange(long time)
          Executed when an Exchange is complete.
 void failedExchange()
          Executed when an Exchange failed.
 boolean isStatisticsEnabled()
          Is statistics enabled.
 void setCounter(PerformanceCounter counter)
           
 void setStatisticsEnabled(boolean statisticsEnabled)
          Sets whether statistics is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatePerformanceCounter

public DelegatePerformanceCounter()
Method Detail

setCounter

public void setCounter(PerformanceCounter counter)

completedExchange

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

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

failedExchange

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

Specified by:
failedExchange in interface PerformanceCounter

isStatisticsEnabled

public boolean isStatisticsEnabled()
Description copied from interface: PerformanceCounter
Is statistics enabled.

They can be enabled and disabled at runtime

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

setStatisticsEnabled

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

They can be enabled and disabled at runtime

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


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.