Package org.apache.camel.management
Class DelegatePerformanceCounter
- java.lang.Object
-
- org.apache.camel.management.DelegatePerformanceCounter
-
- All Implemented Interfaces:
PerformanceCounter
public class DelegatePerformanceCounter extends Object implements PerformanceCounter
Delegates to anotherPerformanceCounter
. 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 theLifecycleStrategy
then we link this to the realManagedPerformanceCounter
mbean so the mbean can gather statistics. This delegation is needed as how Camel is designed to register services in theLifecycleStrategy
in various stages.
-
-
Constructor Summary
Constructors Constructor Description DelegatePerformanceCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
completedExchange(org.apache.camel.Exchange exchange, long time)
Executed when anExchange
is complete.void
failedExchange(org.apache.camel.Exchange exchange)
Executed when anExchange
failed.boolean
isStatisticsEnabled()
Are statistics enabled?void
processExchange(org.apache.camel.Exchange exchange, String type)
Executed when anExchange
is about to be processed.void
setCounter(PerformanceCounter counter)
void
setStatisticsEnabled(boolean statisticsEnabled)
Sets whether statistics are enabled.String
toString()
-
-
-
Constructor Detail
-
DelegatePerformanceCounter
public DelegatePerformanceCounter()
-
-
Method Detail
-
setCounter
public void setCounter(PerformanceCounter counter)
-
processExchange
public void processExchange(org.apache.camel.Exchange exchange, String type)
Description copied from interface:PerformanceCounter
Executed when anExchange
is about to be processed.- Specified by:
processExchange
in interfacePerformanceCounter
- Parameters:
exchange
- the exchangetype
- the node type
-
completedExchange
public void completedExchange(org.apache.camel.Exchange exchange, long time)
Description copied from interface:PerformanceCounter
Executed when anExchange
is complete.- Specified by:
completedExchange
in interfacePerformanceCounter
- Parameters:
exchange
- the exchangetime
- the time it took in millis to complete
-
failedExchange
public void failedExchange(org.apache.camel.Exchange exchange)
Description copied from interface:PerformanceCounter
Executed when anExchange
failed.- Specified by:
failedExchange
in interfacePerformanceCounter
- 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 interfacePerformanceCounter
- 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 interfacePerformanceCounter
- Parameters:
statisticsEnabled
- whether statistics are enabled or not
-
-