public class SynchronizationAdapter extends Object implements SynchronizationVetoable, Ordered, SynchronizationRouteAware
Synchronization
adapter with empty methods for easier overriding
of single methods.Constructor and Description |
---|
SynchronizationAdapter() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowHandover()
Whether or not handover this synchronization is allowed.
|
int |
getOrder()
Gets the order.
|
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. |
void |
onComplete(Exchange exchange)
Called when the processing of the message exchange is complete
|
void |
onDone(Exchange exchange) |
void |
onFailure(Exchange exchange)
Called when the processing of the message exchange has failed for some reason.
|
public SynchronizationAdapter()
public void onComplete(Exchange exchange)
Synchronization
onComplete
in interface Synchronization
exchange
- the exchange being processedpublic void onFailure(Exchange exchange)
Synchronization
Exchange.getException()
and
there could be a fault message via Message.isFault()
onFailure
in interface Synchronization
exchange
- the exchange being processedpublic boolean allowHandover()
SynchronizationVetoable
Exchange
is being routed
from one thread to another thread, such as using request/reply over SEDAallowHandover
in interface SynchronizationVetoable
public int getOrder()
Ordered
Integer.MAX_VALUE
or eg Ordered.LOWEST
.public void onBeforeRoute(Route route, Exchange exchange)
SynchronizationRouteAware
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.onBeforeRoute
in interface SynchronizationRouteAware
route
- the routeexchange
- the exchangepublic void onAfterRoute(Route route, Exchange exchange)
SynchronizationRouteAware
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:
Synchronization.onComplete(org.apache.camel.Exchange)
or Synchronization.onFailure(org.apache.camel.Exchange)
Consumer
prepares and writes
any data back to the caller (if in InOut mode).onAfterRoute
in interface SynchronizationRouteAware
route
- the routeexchange
- the exchangeApache Camel