|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 UnitOfWork
object
- 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 UnitOfWork
object
- The object.
TransactionException
LockException
UnitOfWork.registerDirty(org.apache.lenya.transaction.Transactionable)
public void registerRemoved(Transactionable object) throws TransactionException
UnitOfWork
registerRemoved
in interface UnitOfWork
object
- The object.
TransactionException
- if an error occurs.UnitOfWork.registerRemoved(org.apache.lenya.transaction.Transactionable)
public void commit() throws TransactionException
commit
in interface UnitOfWork
TransactionException
- if an error occurs.UnitOfWork.commit()
protected void resetTransaction()
protected Identity getIdentity()
public boolean isDirty(Transactionable transactionable)
isDirty
in interface UnitOfWork
transactionable
- A transactionable.
UnitOfWork.isDirty(org.apache.lenya.transaction.Transactionable)
public void rollback() throws TransactionException
rollback
in interface UnitOfWork
TransactionException
- if an error occurs.UnitOfWork.rollback()
public Lock createLock(Lockable lockable, int version) throws TransactionException
UnitOfWork
createLock
in interface UnitOfWork
lockable
- 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 UnitOfWork
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 |