|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.pimento.context.AbstractPersistenceContextPhaseListener
org.spicefactory.pimento.context.SpringPersistenceContextPhaseListener
public class SpringPersistenceContextPhaseListener
Implementation of Cinnamon's PhaseListener extension point that uses Springs transaction management and JPA support.
| Constructor Summary | |
|---|---|
SpringPersistenceContextPhaseListener(PlatformTransactionManager txManager,
EntityManagerFactory emf)
Creates a new instance. |
|
| Method Summary | |
|---|---|
protected boolean |
bindEntityManager()
Bind an EntityManager to the current thread. |
protected void |
commitTransaction(Object transactionContext)
Commits the transaction represented by the specified parameter. |
protected Object |
createTransaction()
Creates a transaction and returns a transaction status object. |
protected void |
rollbackTransaction(Object transactionContext)
Performs a rollback for the transaction represented by the specified parameter. |
protected void |
unbindEntityManager()
Unbind the EntityManager from the current thread. |
| Methods inherited from class org.spicefactory.pimento.context.AbstractPersistenceContextPhaseListener |
|---|
afterDecodingException, afterEncoding, afterProcessing, beforeDecoding, beforeProcessing, containsError, createRequestContext, getEntityManagerFactory, releaseRequestContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpringPersistenceContextPhaseListener(PlatformTransactionManager txManager,
EntityManagerFactory emf)
txManager - the transaction manager to useemf - the EntityManagerFactory to use| Method Detail |
|---|
protected Object createTransaction()
AbstractPersistenceContextPhaseListener
createTransaction in class AbstractPersistenceContextPhaseListenerprotected void commitTransaction(Object transactionContext)
AbstractPersistenceContextPhaseListenercreateTransaction.
commitTransaction in class AbstractPersistenceContextPhaseListenertransactionContext - the status object for the transaction to commitprotected void rollbackTransaction(Object transactionContext)
AbstractPersistenceContextPhaseListenercreateTransaction.
rollbackTransaction in class AbstractPersistenceContextPhaseListenertransactionContext - the status object for the transaction to rollbackprotected boolean bindEntityManager()
AbstractPersistenceContextPhaseListener
bindEntityManager in class AbstractPersistenceContextPhaseListenerprotected void unbindEntityManager()
AbstractPersistenceContextPhaseListener
unbindEntityManager in class AbstractPersistenceContextPhaseListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||