|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface UnitOfWork
This is a "Unit of Work" object (see "Unit of Work" pattern by Martin Fowler, http://www.martinfowler.com/eaaCatalog/unitOfWork.html : the unit of work "maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems".
In the current design, this interface allows a use case to generate documents, while ensuring that only one instance of a document is created. This access is provided by the DocumentIdentityMap's DocumentFactory.
This interface may be extended in the future to allow for access to further types of business objects.
| Method Summary | |
|---|---|
void |
commit()
Commits the transaction. |
Lock |
createLock(Lockable lockable,
int version)
Creates a lock. |
boolean |
isDirty(Transactionable transactionable)
|
void |
registerDirty(Transactionable object)
Registers an object as modified. |
void |
registerNew(Transactionable object)
Registers an object as new. |
void |
registerRemoved(Transactionable object)
Registers an object as removed. |
void |
removeLock(Lockable lockable)
Removes a lock. |
void |
rollback()
Rolls the transaction back. |
| Method Detail |
|---|
void registerNew(Transactionable object)
throws TransactionException
object - The object.
TransactionException - if an error occurs.
void registerDirty(Transactionable object)
throws TransactionException
object - The object.
TransactionException - if an error occurs.
void registerRemoved(Transactionable object)
throws TransactionException
object - The object.
TransactionException - if an error occurs.
void commit()
throws TransactionException
TransactionException - if an error occurs.
void rollback()
throws TransactionException
TransactionException - if an error occurs.boolean isDirty(Transactionable transactionable)
transactionable - A transactionable.
Lock createLock(Lockable lockable,
int version)
throws TransactionException
lockable - The lockable.version - The version.
TransactionException - if a lock is already placed on this transactionable.
void removeLock(Lockable lockable)
throws TransactionException
lockable - The lockable.
TransactionException - if no lock is placed on this transactionable.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||