org.apache.camel.impl
Class SynchronizationAdapter

java.lang.Object
  extended by org.apache.camel.impl.SynchronizationAdapter
All Implemented Interfaces:
Synchronization, SynchronizationVetoable

public class SynchronizationAdapter
extends Object
implements SynchronizationVetoable

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

Version:
$Revision: 933214 $

Constructor Summary
SynchronizationAdapter()
           
 
Method Summary
 boolean allowHandover()
          Whether or not handover this synchronization is allowed.
 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 toAsync etc.

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


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.