org.qi4j.api.unitofwork
Interface UnitOfWorkCallback

All Known Subinterfaces:
ScheduleEntity
All Known Implementing Classes:
ScheduleEntityMixin

public interface UnitOfWorkCallback

Callback interface for UnitOfWork completion or discard. Implementations of this interface can be registered through UnitOfWork.addUnitOfWorkCallback(UnitOfWorkCallback). If Entities implement this interface they will also receive invocations of this callback interface.


Nested Class Summary
static class UnitOfWorkCallback.UnitOfWorkStatus
           
 
Method Summary
 void afterCompletion(UnitOfWorkCallback.UnitOfWorkStatus status)
          This is called after the completion or discarding of the UnitOfWork.
 void beforeCompletion()
          This is called before the completion of the UnitOfWork.
 

Method Detail

beforeCompletion

void beforeCompletion()
                      throws UnitOfWorkCompletionException
This is called before the completion of the UnitOfWork. The callback may do any validation checks and throw UnitOfWorkCompletionException if there is any reason why the UnitOfWork is not in a valid state to be completed.

Throws:
UnitOfWorkCompletionException

afterCompletion

void afterCompletion(UnitOfWorkCallback.UnitOfWorkStatus status)
This is called after the completion or discarding of the UnitOfWork. The callback may do any cleanup necessary related to the UnitOfWork. Note that the UnitOfWork is no longer active when this method is called, so no methods on it may be invoked.

Parameters:
status -