dain        2005/02/26 21:54:02

  Modified:    modules/core/src/java/org/openejb/sfsb AfterBegin.java
                        AfterCompletion.java BeforeCompletion.java
  Log:

  Set timer state
  
  Revision  Changes    Path
  1.2       +4 -1      
openejb/modules/core/src/java/org/openejb/sfsb/AfterBegin.java
  
  Index: AfterBegin.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/AfterBegin.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AfterBegin.java   15 Feb 2005 03:24:03 -0000      1.1
  +++ AfterBegin.java   27 Feb 2005 02:53:58 -0000      1.2
  @@ -54,6 +54,7 @@
   import org.apache.geronimo.core.service.SimpleInvocationResult;
   import org.openejb.EJBInvocation;
   import org.openejb.EJBOperation;
  +import org.openejb.timer.TimerState;
   import org.openejb.dispatch.VirtualOperation;
   
   /**
  @@ -66,12 +67,14 @@
   
       public InvocationResult execute(EJBInvocation invocation) throws 
Throwable {
           StatefulInstanceContext ctx = (StatefulInstanceContext) 
invocation.getEJBInstanceContext();
  +        boolean oldTimerMethodAvailable = 
ctx.setTimerState(EJBOperation.BIZMETHOD);
           EJBOperation oldOperation = ctx.getOperation();
           try {
               ctx.setOperation(EJBOperation.BIZMETHOD);
               ((SessionSynchronization) ctx.getInstance()).afterBegin();
           } finally {
               ctx.setOperation(oldOperation);
  +            TimerState.setTimerState(oldTimerMethodAvailable);
           }
           return new SimpleInvocationResult(true, null);
       }
  
  
  
  1.2       +4 -1      
openejb/modules/core/src/java/org/openejb/sfsb/AfterCompletion.java
  
  Index: AfterCompletion.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/AfterCompletion.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AfterCompletion.java      15 Feb 2005 03:24:03 -0000      1.1
  +++ AfterCompletion.java      27 Feb 2005 02:53:58 -0000      1.2
  @@ -54,6 +54,7 @@
   import org.apache.geronimo.core.service.SimpleInvocationResult;
   import org.openejb.EJBInvocation;
   import org.openejb.EJBOperation;
  +import org.openejb.timer.TimerState;
   import org.openejb.dispatch.VirtualOperation;
   
   /**
  @@ -67,12 +68,14 @@
       public InvocationResult execute(EJBInvocation invocation) throws 
Throwable {
           boolean comitted = 
((Boolean)invocation.getArguments()[0]).booleanValue();
           StatefulInstanceContext ctx = (StatefulInstanceContext) 
invocation.getEJBInstanceContext();
  +        boolean oldTimerMethodAvailable = 
ctx.setTimerState(EJBOperation.EJBCREATE);
           EJBOperation oldOperation = ctx.getOperation();
           try {
               ctx.setOperation(EJBOperation.EJBCREATE);
               ((SessionSynchronization) 
ctx.getInstance()).afterCompletion(comitted);
           } finally {
               ctx.setOperation(oldOperation);
  +            TimerState.setTimerState(oldTimerMethodAvailable);
           }
           return new SimpleInvocationResult(true, null);
       }
  
  
  
  1.2       +4 -1      
openejb/modules/core/src/java/org/openejb/sfsb/BeforeCompletion.java
  
  Index: BeforeCompletion.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/BeforeCompletion.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BeforeCompletion.java     15 Feb 2005 03:24:03 -0000      1.1
  +++ BeforeCompletion.java     27 Feb 2005 02:54:02 -0000      1.2
  @@ -54,6 +54,7 @@
   import org.apache.geronimo.core.service.SimpleInvocationResult;
   import org.openejb.EJBInvocation;
   import org.openejb.EJBOperation;
  +import org.openejb.timer.TimerState;
   import org.openejb.dispatch.VirtualOperation;
   
   /**
  @@ -66,12 +67,14 @@
   
       public InvocationResult execute(EJBInvocation invocation) throws 
Throwable {
           StatefulInstanceContext ctx = (StatefulInstanceContext) 
invocation.getEJBInstanceContext();
  +        boolean oldTimerMethodAvailable = 
ctx.setTimerState(EJBOperation.BIZMETHOD);
           EJBOperation oldOperation = ctx.getOperation();
           try {
               ctx.setOperation(EJBOperation.BIZMETHOD);
               ((SessionSynchronization) ctx.getInstance()).beforeCompletion();
           } finally {
               ctx.setOperation(oldOperation);
  +            TimerState.setTimerState(oldTimerMethodAvailable);
           }
           return new SimpleInvocationResult(true, null);
       }
  
  
  

Reply via email to