[jboss-cvs] jboss-seam/src/main/org/jboss/seam/bpm ...

Gavin King gavin.king at jboss.com
Sun Jun 24 02:34:31 EDT 2007


  User: gavin   
  Date: 07/06/24 02:34:31

  Modified:    src/main/org/jboss/seam/bpm  ManagedJbpmContext.java
  Log:
  got rid of TransactionListener, merged with the Transaction package, for more consistent behavior across diff types of tx management
  
  Revision  Changes    Path
  1.8       +7 -8      jboss-seam/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ManagedJbpmContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- ManagedJbpmContext.java	22 Jun 2007 15:28:56 -0000	1.7
  +++ ManagedJbpmContext.java	24 Jun 2007 06:34:31 -0000	1.8
  @@ -24,11 +24,10 @@
   import org.jboss.seam.annotations.intercept.BypassInterceptors;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.contexts.Lifecycle;
  -import org.jboss.seam.core.TransactionListener;
  -import org.jboss.seam.core.BasicTransactionListener;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
   import org.jboss.seam.transaction.Transaction;
  +import org.jboss.seam.transaction.UserTransaction;
   import org.jbpm.JbpmContext;
   import org.jbpm.persistence.db.DbPersistenceServiceFactory;
   import org.jbpm.svc.Services;
  @@ -71,19 +70,19 @@
      @Unwrap
      public JbpmContext getJbpmContext() throws NamingException, RollbackException, SystemException
      {
  -      if ( !Transaction.instance().isActiveOrMarkedRollback() )
  +      UserTransaction transaction = Transaction.instance();
  +      if ( !transaction.isActiveOrMarkedRollback() )
         {
            throw new IllegalStateException("JbpmContext may only be used inside a transaction");
         }
  -      if ( !synchronizationRegistered && !Lifecycle.isDestroying() && Transaction.instance().isActive() )
  +      if ( !synchronizationRegistered && !Lifecycle.isDestroying() && transaction.isActive() )
         {
            jbpmContext.getSession().isOpen();
  -         TransactionListener transactionListener = BasicTransactionListener.instance();
  -         if (transactionListener!=null)
  +         try //TODO: what we really want here is if (!cmt)
            {
  -            transactionListener.registerSynchronization(this);
  +            transaction.registerSynchronization(this);
            }
  -         else
  +         catch (UnsupportedOperationException uoe)
            {
               jbpmContext.getSession().getTransaction().registerSynchronization(this);
            }
  
  
  



More information about the jboss-cvs-commits mailing list