org.apache.camel.processor
Class CamelInternalProcessor.InstrumentationAdvice

java.lang.Object
  extended by org.apache.camel.processor.CamelInternalProcessor.InstrumentationAdvice
All Implemented Interfaces:
CamelInternalProcessorAdvice<StopWatch>
Enclosing class:
CamelInternalProcessor

public static class CamelInternalProcessor.InstrumentationAdvice
extends Object
implements CamelInternalProcessorAdvice<StopWatch>

Advice for JMX instrumentation of the process being invoked.

This advice keeps track of JMX metrics for performance statistics.

The current implementation of this advice is only used for route level statistics. For processor levels they are still wrapped in the route processor chains.


Constructor Summary
CamelInternalProcessor.InstrumentationAdvice(String type)
           
 
Method Summary
 void after(Exchange exchange, StopWatch watch)
          Callback executed after processing a step in the route.
 StopWatch before(Exchange exchange)
          Callback executed before processing a step in the route.
 String getType()
           
protected  void recordTime(Exchange exchange, long duration)
           
 void setCounter(Object counter)
           
 void setType(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelInternalProcessor.InstrumentationAdvice

public CamelInternalProcessor.InstrumentationAdvice(String type)
Method Detail

setCounter

public void setCounter(Object counter)

recordTime

protected void recordTime(Exchange exchange,
                          long duration)

getType

public String getType()

setType

public void setType(String type)

before

public StopWatch before(Exchange exchange)
                 throws Exception
Description copied from interface: CamelInternalProcessorAdvice
Callback executed before processing a step in the route.

Specified by:
before in interface CamelInternalProcessorAdvice<StopWatch>
Parameters:
exchange - the current exchange
Returns:
any state to keep and provide as data to the CamelInternalProcessorAdvice.after(org.apache.camel.Exchange, Object) method, or use null for no state.
Throws:
Exception - is thrown if error during the call.

after

public void after(Exchange exchange,
                  StopWatch watch)
           throws Exception
Description copied from interface: CamelInternalProcessorAdvice
Callback executed after processing a step in the route.

Specified by:
after in interface CamelInternalProcessorAdvice<StopWatch>
Parameters:
exchange - the current exchange
watch - the state, if any, returned in the CamelInternalProcessorAdvice.before(org.apache.camel.Exchange) method.
Throws:
Exception - is thrown if error during the call.


Apache Camel