|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.lenya.transaction.UnitOfWorkImpl
public class UnitOfWorkImpl
Default implementation of a unit of work.
| Constructor Summary | |
|---|---|
UnitOfWorkImpl(IdentityMap map,
Identity identity,
org.apache.avalon.framework.logger.Logger logger)
Ctor. |
|
| Method Summary | |
|---|---|
void |
commit()
Commit the transaction. |
Lock |
createLock(Lockable lockable,
int version)
Creates a lock. |
protected Identity |
getIdentity()
|
IdentityMap |
getIdentityMap()
|
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. |
protected void |
resetTransaction()
|
void |
rollback()
Rollback the transaction. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnitOfWorkImpl(IdentityMap map,
Identity identity,
org.apache.avalon.framework.logger.Logger logger)
map - The identity map to use.identity - The identity.logger - The logger.| Method Detail |
|---|
public IdentityMap getIdentityMap()
public void registerNew(Transactionable object)
throws TransactionException
UnitOfWork
registerNew in interface UnitOfWorkobject - The object.
TransactionException - if an error occurs.UnitOfWork.registerNew(org.apache.lenya.transaction.Transactionable)
public void registerDirty(Transactionable object)
throws TransactionException
UnitOfWork
registerDirty in interface UnitOfWorkobject - The object.
TransactionException
LockExceptionUnitOfWork.registerDirty(org.apache.lenya.transaction.Transactionable)
public void registerRemoved(Transactionable object)
throws TransactionException
UnitOfWork
registerRemoved in interface UnitOfWorkobject - The object.
TransactionException - if an error occurs.UnitOfWork.registerRemoved(org.apache.lenya.transaction.Transactionable)
public void commit()
throws TransactionException
commit in interface UnitOfWorkTransactionException - if an error occurs.UnitOfWork.commit()protected void resetTransaction()
protected Identity getIdentity()
public boolean isDirty(Transactionable transactionable)
isDirty in interface UnitOfWorktransactionable - A transactionable.
UnitOfWork.isDirty(org.apache.lenya.transaction.Transactionable)
public void rollback()
throws TransactionException
rollback in interface UnitOfWorkTransactionException - if an error occurs.UnitOfWork.rollback()
public Lock createLock(Lockable lockable,
int version)
throws TransactionException
UnitOfWork
createLock in interface UnitOfWorklockable - The lockable.version - The version.
TransactionException - if a lock is already placed on this transactionable.
public void removeLock(Lockable lockable)
throws TransactionException
UnitOfWork
removeLock in interface UnitOfWorklockable - 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 | |||||||