Author: rmannibucau
Date: Sat Aug 11 10:41:16 2012
New Revision: 1371909

URL: http://svn.apache.org/viewvc?rev=1371909&view=rev
Log:
why timer was started in deploy andnot start? typically the statinterceptor is 
created in start, not deploy, the other solution is to merge both method 
(container.deploy/start) keeping the timer.start the last operation

Modified:
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/singleton/SingletonContainer.java
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/singleton/SingletonContainer.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/singleton/SingletonContainer.java?rev=1371909&r1=1371908&r2=1371909&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/singleton/SingletonContainer.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/singleton/SingletonContainer.java
 Sat Aug 11 10:41:16 2012
@@ -110,17 +110,16 @@ public class SingletonContainer implemen
             deploymentRegistry.put(id, beanContext);
             beanContext.setContainer(this);
         }
-
-        EjbTimerService timerService = beanContext.getEjbTimerService();
-        if (timerService != null) {
-            timerService.start();
-        }
-
     }
 
     @Override
     public void start(BeanContext info) throws OpenEJBException {
         instanceManager.start(info);
+
+        EjbTimerService timerService = info.getEjbTimerService();
+        if (timerService != null) {
+            timerService.start();
+        }
     }
 
     @Override

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java?rev=1371909&r1=1371908&r2=1371909&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
 Sat Aug 11 10:41:16 2012
@@ -100,16 +100,17 @@ public class StatelessContainer implemen
             deploymentRegistry.put(id, beanContext);
             beanContext.setContainer(this);
         }
+    }
+
+    public void start(BeanContext beanContext) throws OpenEJBException {
+        instanceManager.deploy(beanContext);
 
+        // do it after the instance deployment
         EjbTimerService timerService = beanContext.getEjbTimerService();
         if (timerService != null) {
             timerService.start();
         }
     }
-
-    public void start(BeanContext beanContext) throws OpenEJBException {
-        instanceManager.deploy(beanContext);
-    }
     
     public void stop(BeanContext beanContext) throws OpenEJBException {
         beanContext.stop();


Reply via email to