org.apache.camel.spi
Interface SubUnitOfWorkCallback

All Known Implementing Classes:
DefaultSubUnitOfWork

public interface SubUnitOfWorkCallback

To allow unit of work for the UnitOfWork while processing a number of Exchanges.

A sub unit of work is a way of implement sub-transactions in Camel routing. This is needed by some EIPs where you can have sub routes such as the Splitter. The Camel end user may want to indicate that the Splitter should act as a single combined unit of work.

To implement this, we use this SubUnitOfWorkCallback which allows us to have the sub routes participate in a SubUnitOfWork And then the outcome of the SubUnitOfWork will be a single atomic commit or rollback.

When using a SubUnitOfWork we need to tap into the sub routes, and ensure they callback with the progress of the sub Exchange being processed. For example the error handler, we need to tap into, and ensure that any exhausted sub Exchange is propagated into the result of the SubUnitOfWork. This SubUnitOfWorkCallback allows us to do that.

See Also:
SubUnitOfWork

Method Summary
 void onDone(Exchange exchange)
          The exchange is done.
 void onExhausted(Exchange exchange)
          The exchange is exhausted, by a redeliverable error handler.
 

Method Detail

onExhausted

void onExhausted(Exchange exchange)
The exchange is exhausted, by a redeliverable error handler.

Parameters:
exchange - the exchange

onDone

void onDone(Exchange exchange)
The exchange is done.

Parameters:
exchange - the exchange.


Apache CAMEL