|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schwarzrot.data.transaction.ApplicationTransaction
public class ApplicationTransaction
An ApplicationTransaction is a wrapper around
TransactionalOperations, which can be added to setup a transaction.
The transaction is then executed by the Repository and so the
transaction may span different persistent resources, but the application does
not need to care about those resources nor does it need to know, which
resource is involved.
The application only adds an Entity or several entities together with
the opcode, which should be applied to that entities.
So, the enlisting/delisting of resources is internal to the transaction
processor, which in this case is the Repository.
This transaction implements a VetoableChangeSupport for changes of
the transaction status. These status values are vetoable:
| Constructor Summary | |
|---|---|
ApplicationTransaction()
|
|
| Method Summary | |
|---|---|
void |
add(TransactionalOperation<?> tao)
used to add an operation to the transaction. |
void |
addVetoableStatusListener(VetoableChangeListener listener)
add vetoable change listener to the transaction. |
void |
execute()
executes all added operations |
TransactionalOperation.DataDirection |
getDataDirection()
internal use only. |
List<TransactionalOperation<?>> |
getOperations()
internal use only. |
TransactionResource<?> |
getResource(EntityManager em)
internal use only. |
TransactionStatus |
getStatus()
accessor to the transactions status |
boolean |
isEntityManagerRegistered(EntityManager em)
internal use only. |
boolean |
isRollbackOnly()
internal use only. |
Collection<EntityManager> |
registeredManagers()
internal use only. |
void |
registerResource(EntityManager em,
TransactionResource<?> res)
internal use only. |
void |
setRollbackOnly()
use this, if the transaction does only read operations. |
void |
setStatus(TransactionStatus ts)
internal use only. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ApplicationTransaction()
| Method Detail |
|---|
public void add(TransactionalOperation<?> tao)
Transaction
add in interface Transactiontao - the operation to add to the transactionpublic void addVetoableStatusListener(VetoableChangeListener listener)
Transaction
addVetoableStatusListener in interface Transactionlistener - - the listener to addpublic void execute()
Transaction
execute in interface Transactionpublic TransactionalOperation.DataDirection getDataDirection()
TransactionEntityManager to open
the TransactionResource in an appropriate way.
getDataDirection in interface Transactionpublic List<TransactionalOperation<?>> getOperations()
TransactionRepository
getOperations in interface Transactionpublic TransactionResource<?> getResource(EntityManager em)
TransactionRepository
getResource in interface Transactionem - the EntityManager, that created that resource
TransactionResourcepublic TransactionStatus getStatus()
Transaction
getStatus in interface Transactionpublic boolean isEntityManagerRegistered(EntityManager em)
TransactionRepository
isEntityManagerRegistered in interface Transactionem - the EntityManager of interest
EntityManager has been used in a previous
operation, otherwise falsepublic boolean isRollbackOnly()
TransactionRepository
isRollbackOnly in interface Transactionpublic Collection<EntityManager> registeredManagers()
TransactionRepository
registeredManagers in interface TransactionEntityManagers
public void registerResource(EntityManager em,
TransactionResource<?> res)
TransactionRepository
registerResource in interface Transactionem - the EntityManager, that created the
TransactionResourceres - the created TransactionResourcepublic void setRollbackOnly()
TransactionEntity
setRollbackOnly in interface Transaction
public void setStatus(TransactionStatus ts)
throws PropertyVetoException
TransactionRepository
setStatus in interface Transactionts - the new status
PropertyVetoException
|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||