org.apache.camel.processor
Interface CamelInternalProcessorAdvice<T>

Type Parameters:
T -
All Known Implementing Classes:
CamelInternalProcessor.BacklogDebuggerAdvice, CamelInternalProcessor.BacklogTracerAdvice, CamelInternalProcessor.ChildUnitOfWorkProcessorAdvice, CamelInternalProcessor.DelayerAdvice, CamelInternalProcessor.InstrumentationAdvice, CamelInternalProcessor.MessageHistoryAdvice, CamelInternalProcessor.RouteContextAdvice, CamelInternalProcessor.RouteInflightRepositoryAdvice, CamelInternalProcessor.RoutePolicyAdvice, CamelInternalProcessor.StreamCachingAdvice, CamelInternalProcessor.SubUnitOfWorkProcessorAdvice, CamelInternalProcessor.UnitOfWorkProcessorAdvice

public interface CamelInternalProcessorAdvice<T>

An advice (before and after) to execute cross cutting functionality in the Camel routing engine.

The Camel routing engine will execute the before(org.apache.camel.Exchange) and after(org.apache.camel.Exchange, Object) methods during routing in correct order.

See Also:
CamelInternalProcessor

Method Summary
 void after(Exchange exchange, T data)
          Callback executed after processing a step in the route.
 T before(Exchange exchange)
          Callback executed before processing a step in the route.
 

Method Detail

before

T before(Exchange exchange)
         throws Exception
Callback executed before processing a step in the route.

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

after

void after(Exchange exchange,
           T data)
           throws Exception
Callback executed after processing a step in the route.

Parameters:
exchange - the current exchange
data - the state, if any, returned in the before(org.apache.camel.Exchange) method.
Throws:
Exception - is thrown if error during the call.


Apache Camel