org.apache.camel.spi
Interface UnitOfWork

All Known Implementing Classes:
DefaultUnitOfWork

public interface UnitOfWork

An object representing the unit of work processing an Exchange which allows the use of Synchronization hooks. This object might map one-to-one with a transaction in JPA or Spring; or might not.

Version:
$Revision: 1109 $

Method Summary
 void addSynchronization(Synchronization synchronization)
          Adds a synchronization hook
 void done(Exchange exchange)
          Invoked when this unit of work has been completed, whether it has failed or completed
 String getId()
          Returns the unique ID of this unit of work, lazily creating one if it does not yet have one
 void removeSynchronization(Synchronization synchronization)
          Removes a synchronization hook
 

Method Detail

addSynchronization

void addSynchronization(Synchronization synchronization)
Adds a synchronization hook

Parameters:
synchronization - the hook

removeSynchronization

void removeSynchronization(Synchronization synchronization)
Removes a synchronization hook

Parameters:
synchronization - the hook

done

void done(Exchange exchange)
Invoked when this unit of work has been completed, whether it has failed or completed

Parameters:
exchange - the current exchange

getId

String getId()
Returns the unique ID of this unit of work, lazily creating one if it does not yet have one

Returns:
the unique ID


Copyright © 2009 IONA Open Source Community. All Rights Reserved.