org.apache.camel.spi
Interface SynchronizationRouteAware

All Superinterfaces:
Synchronization
All Known Implementing Classes:
SynchronizationAdapter, SynchronizationAdapter

public interface SynchronizationRouteAware
extends Synchronization

An extended Synchronization which is route aware.


Method Summary
 void onAfterRoute(Route route, Exchange exchange)
          Invoked after the Exchange has been routed by the given route.
 void onBeforeRoute(Route route, Exchange exchange)
          Invoked before the Exchange is being routed by the given route.
 
Methods inherited from interface org.apache.camel.spi.Synchronization
onComplete, onFailure
 

Method Detail

onBeforeRoute

void onBeforeRoute(Route route,
                   Exchange exchange)
Invoked before the Exchange is being routed by the given route.

Notice if the exchange is being routed through multiple routes, there will be callbacks for each route.

Important: this callback may not invoked if the SynchronizationRouteAware implementation is being added to the UnitOfWork after the routing has started.

Parameters:
route - the route
exchange - the exchange

onAfterRoute

void onAfterRoute(Route route,
                  Exchange exchange)
Invoked after the Exchange has been routed by the given route.

Notice if the exchange is being routed through multiple routes, there will be callbacks for each route.

This invocation happens before these callbacks:

This allows custom logic to be executed after all routing is done, but before the Consumer prepares and writes any data back to the caller (if in InOut mode).

Parameters:
route - the route
exchange - the exchange


Apache Camel