public final class ResourceListenerNotifier extends java.lang.Object implements TransactionListener
Constructor and Description |
---|
ResourceListenerNotifier(ConfigServiceImpl configService) |
Modifier and Type | Method and Description |
---|---|
void |
afterBegin(Transaction tr)
Invoked right after the transaction begins.
|
void |
afterEnd(Transaction tr)
Invoked after the transaction ends, namely, after the transaction fully commits or fully rolled back.
|
void |
beforeEnd(Transaction tr)
Invoked right before the transaction commits or rollsback.
|
void |
beforePrepare(Transaction tr)
Invoked right before the prepare phase starts.
|
java.lang.String |
getId()
Unique name for this transactional listener
|
boolean |
rollbackOnFailure()
Indicates whether exceptions from
TransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction) methods cause the transaction to rollback. |
void |
sendLoadNotifications() |
void |
sendLoadNotifications(java.lang.String session) |
public ResourceListenerNotifier(ConfigServiceImpl configService)
public java.lang.String getId()
TransactionListener
getId
in interface TransactionListener
public boolean rollbackOnFailure()
TransactionListener
TransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction)
methods cause the transaction to rollback.rollbackOnFailure
in interface TransactionListener
TransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction)
method raises exceptions; false otherwisepublic void afterBegin(Transaction tr)
TransactionListener
is called
.
Exception behavior: While the implementations are not supposed to throw exceptions, any unchecked exception will cause the transaction to be abandoned and the caller of the beginTransaction method will get a TransactionException
This method is invoked under the TransactionManager lock.
afterBegin
in interface TransactionListener
public void beforePrepare(Transaction tr) throws java.lang.Exception
TransactionListener
Transaction.Status.Active
. However it is possible that the transaction may be marked as rollback-only (Transaction.Status.MarkedRollback
) after this decision is made and the method is called. Therefore the implementations of this method should not rely on the fact that the transaction status is Transaction.Status.Active
.
This method is NOT called if the transaction was marked for rollback only at the time of the decision.
This also implies that if a call to this method fails with an exception and the rollbackOnFailure flag is true for that listener (See TransactionListener.rollbackOnFailure()
) , no beforePrepare method is called for the subsequent listeners.
This method is currently invoked outside the TransactionManager lock.
beforePrepare
in interface TransactionListener
java.lang.Exception
public void beforeEnd(Transaction tr)
TransactionListener
Transaction.Status.Rollingback
or Transaction.Status.Committing
.
Exception behavior: While the implementations are not supposed to throw exceptions, any unchecked exception will be completely ignored. The remainder of the notifications are delivered normally.
This method is invoked under the TransactionManager lock.
beforeEnd
in interface TransactionListener
public void afterEnd(Transaction tr)
TransactionListener
Transaction.Status.Rolledback
or Transaction.Status.Committed
.
This method is invoked under the TransactionManager lock.
afterEnd
in interface TransactionListener
public void sendLoadNotifications()
public void sendLoadNotifications(java.lang.String session)