org.apache.camel.support
Class SynchronizationAdapter

java.lang.Object
  extended by org.apache.camel.support.SynchronizationAdapter
All Implemented Interfaces:
Ordered, Synchronization, SynchronizationVetoable
Direct Known Subclasses:
SynchronizationAdapter

public class SynchronizationAdapter
extends Object
implements SynchronizationVetoable, Ordered

Simple Synchronization adapter with empty methods for easier overriding of single methods.

Version:

Field Summary
 
Fields inherited from interface org.apache.camel.Ordered
HIGHEST, LOWEST
 
Constructor Summary
SynchronizationAdapter()
           
 
Method Summary
 boolean allowHandover()
          Whether or not handover this synchronization is allowed.
 int getOrder()
          Gets the order.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizationAdapter

public SynchronizationAdapter()
Method Detail

onComplete

public void onComplete(Exchange exchange)
Description copied from interface: Synchronization
Called when the processing of the message exchange is complete

Specified by:
onComplete in interface Synchronization
Parameters:
exchange - the exchange being processed

onFailure

public void onFailure(Exchange exchange)
Description copied from interface: Synchronization
Called when the processing of the message exchange has failed for some reason. The exception which caused the problem is in Exchange.getException() and there could be a fault message via Message.isFault()

Specified by:
onFailure in interface Synchronization
Parameters:
exchange - the exchange being processed

onDone

public void onDone(Exchange exchange)

allowHandover

public boolean allowHandover()
Description copied from interface: SynchronizationVetoable
Whether or not handover this synchronization is allowed.

For example when an Exchange is being routed from one thread to another thread, such as using request/reply over SEDA

Specified by:
allowHandover in interface SynchronizationVetoable
Returns:
true to allow handover, false to deny.

getOrder

public int getOrder()
Description copied from interface: Ordered
Gets the order.

Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then use Integer.MAX_VALUE or eg Ordered.LOWEST.

Specified by:
getOrder in interface Ordered
Returns:
the order


Apache CAMEL