Package org.apache.webbeans.ee.event
Class TransactionalEventNotifier
- java.lang.Object
-
- org.apache.webbeans.ee.event.TransactionalEventNotifier
-
public final class TransactionalEventNotifier extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidregisterTransactionSynchronization(javax.enterprise.event.TransactionPhase phase, javax.enterprise.inject.spi.ObserverMethod<? super Object> observer, Object event, javax.enterprise.inject.spi.EventMetadata metadata)This will get called by the EJB integration code Since registration of the event can blow up if the tx is not active we have a matrix of assumed behaviour There are 3 different error cases when registering a TX Synchronization: RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
-
-
-
Method Detail
-
registerTransactionSynchronization
public static void registerTransactionSynchronization(javax.enterprise.event.TransactionPhase phase, javax.enterprise.inject.spi.ObserverMethod<? super Object> observer, Object event, javax.enterprise.inject.spi.EventMetadata metadata) throws ExceptionThis will get called by the EJB integration code Since registration of the event can blow up if the tx is not active we have a matrix of assumed behaviour There are 3 different error cases when registering a TX Synchronization: RollbackException - Thrown to indicate that the transaction has been marked for rollback only. IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive. SystemException - Thrown if the transaction manager encounters an unexpected error condition. In case of the SystemException we simply let it blow up. This is usually the case if there is some setup problem. In case of a RollbackException or IllegalStateException we will perform different actions based on the desired TransactionPhase: For AFTER_COMPLETION, BEFORE_COMPLETION and AFTER_FAILURE we will deliver the event immediately. For AFTER_SUCCESS we copmletely skip the event. It will not get invoked at all because the transaction will not succeed.- Throws:
Exception
-
-