djencks     2004/10/05 03:04:02

  Modified:    modules/core/src/java/org/openejb/sfsb BusinessMethod.java
                        StatefulInstanceContext.java
                        StatefulInstanceContextFactory.java
                        StatefulSessionContext.java
  Log:

  Use TransactionContextManager rather than TransactionContext static methods.  Mostly 
fix GERONIMO-355. Progress on GERONIMO-347. This demonstrates the problems in 
GERONIMO-359 and GERONIMO-360 (there are now itest failures)
  
  Revision  Changes    Path
  1.4       +2 -1      
openejb/modules/core/src/java/org/openejb/sfsb/BusinessMethod.java
  
  Index: BusinessMethod.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/BusinessMethod.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BusinessMethod.java       18 Jul 2004 22:32:24 -0000      1.3
  +++ BusinessMethod.java       5 Oct 2004 07:04:02 -0000       1.4
  @@ -75,6 +75,7 @@
               if(isBMT) {
                   // we need to update the invocation cache of the transaction context
                   // because they may have used UserTransaction to push a new context
  +                //TODO MOVE THIS TO AN INTERCEPTOR that is included only if the 
bean is BMT
                   invocation.setTransactionContext(TransactionContext.getContext());
               }
           }
  
  
  
  1.7       +4 -3      
openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContext.java
  
  Index: StatefulInstanceContext.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StatefulInstanceContext.java      18 Jul 2004 22:32:24 -0000      1.6
  +++ StatefulInstanceContext.java      5 Oct 2004 07:04:02 -0000       1.7
  @@ -54,6 +54,7 @@
   
   import org.apache.geronimo.core.service.Interceptor;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   import org.openejb.AbstractInstanceContext;
   import org.openejb.EJBOperation;
   import org.openejb.dispatch.SystemMethodIndices;
  @@ -70,12 +71,12 @@
       private final StatefulSessionContext statefulContext;
       private boolean dead = false;
   
  -    public StatefulInstanceContext(Object containerId, EJBProxyFactory 
proxyFactory, SessionBean instance, Object id, UserTransactionImpl userTransaction, 
SystemMethodIndices systemMethodIndices, Interceptor systemChain, Set 
unshareableResources, Set applicationManagedSecurityResources) {
  +    public StatefulInstanceContext(Object containerId, EJBProxyFactory 
proxyFactory, SessionBean instance, Object id, TransactionContextManager 
transactionContextManager, UserTransactionImpl userTransaction, SystemMethodIndices 
systemMethodIndices, Interceptor systemChain, Set unshareableResources, Set 
applicationManagedSecurityResources) {
           //currently stateful beans have no timer service.
           super(systemMethodIndices, systemChain, unshareableResources, 
applicationManagedSecurityResources, instance, proxyFactory, null);
           this.containerId = containerId;
           this.id = id;
  -        statefulContext = new StatefulSessionContext(this, userTransaction);
  +        statefulContext = new StatefulSessionContext(this, 
transactionContextManager, userTransaction);
           setContextInvocation = systemMethodIndices.getSetContextInvocation(this, 
statefulContext);
           unsetContextInvocation = systemMethodIndices.getSetContextInvocation(this, 
null);
       }
  
  
  
  1.11      +8 -2      
openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContextFactory.java
  
  Index: StatefulInstanceContextFactory.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContextFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StatefulInstanceContextFactory.java       17 Sep 2004 21:30:23 -0000      1.10
  +++ StatefulInstanceContextFactory.java       5 Oct 2004 07:04:02 -0000       1.11
  @@ -55,6 +55,7 @@
   
   import org.apache.geronimo.transaction.InstanceContext;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   import org.apache.geronimo.core.service.Interceptor;
   
   import org.openejb.EJBInstanceFactory;
  @@ -79,6 +80,7 @@
       private transient EJBProxyFactory proxyFactory;
       private transient Interceptor systemChain;
       private transient SystemMethodIndices systemMethodIndices;
  +    private transient TransactionContextManager transactionContextManager;
   
       public StatefulInstanceContextFactory(Object containerId, Class beanClass, 
UserTransactionImpl userTransaction, Set unshareableResources, Set 
applicationManagedSecurityResources) {
           this.containerId = containerId;
  @@ -102,6 +104,10 @@
           return systemMethodIndices;
       }
   
  +    public void setTransactionContextManager(TransactionContextManager 
transactionContextManager) {
  +        this.transactionContextManager = transactionContextManager;
  +    }
  +
       public void setTimerService(BasicTimerService timerService) {
           //stateful beans have no timers.
       }
  @@ -115,7 +121,7 @@
                   proxyFactory,
                   (SessionBean) factory.newInstance(),
                   createInstanceId(),
  -                userTransaction,
  +                transactionContextManager, userTransaction,
                   systemMethodIndices, systemChain, unshareableResources,
                   applicationManagedSecurityResources);
       }
  
  
  
  1.4       +4 -3      
openejb/modules/core/src/java/org/openejb/sfsb/StatefulSessionContext.java
  
  Index: StatefulSessionContext.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulSessionContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatefulSessionContext.java       6 Apr 2004 00:43:07 -0000       1.3
  +++ StatefulSessionContext.java       5 Oct 2004 07:04:02 -0000       1.4
  @@ -61,6 +61,7 @@
   import org.openejb.EJBInstanceContext;
   import org.openejb.EJBOperation;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   
   /**
    * Implementation of SessionContext using the State pattern to determine
  @@ -69,8 +70,8 @@
    * @version $Revision$ $Date$
    */
   public class StatefulSessionContext extends EJBContextImpl implements 
SessionContext {
  -    public StatefulSessionContext(StatefulInstanceContext context, 
UserTransactionImpl userTransaction) {
  -        super(context, userTransaction);
  +    public StatefulSessionContext(StatefulInstanceContext context, 
TransactionContextManager transactionContextManager, UserTransactionImpl 
userTransaction) {
  +        super(context, transactionContextManager, userTransaction);
           state = INACTIVE;
       }
   
  
  
  

Reply via email to