[jboss-cvs] JBossAS SVN: r73123 - projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 7 17:38:08 EDT 2008


Author: ALRubinger
Date: 2008-05-07 17:38:08 -0400 (Wed, 07 May 2008)
New Revision: 73123

Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
Log:
[EJBTHREE-1339] Delegate passivation interception to "EJBContainer.invokeCallback"

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-05-07 21:13:46 UTC (rev 73122)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-05-07 21:38:08 UTC (rev 73123)
@@ -27,10 +27,8 @@
 import java.lang.reflect.Modifier;
 import java.rmi.NoSuchObjectException;
 import java.rmi.RemoteException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Hashtable;
-import java.util.List;
 import java.util.Map;
 
 import javax.ejb.EJBHome;
@@ -46,10 +44,7 @@
 import javax.ejb.TimerService;
 
 import org.jboss.aop.Domain;
-import org.jboss.aop.InstanceAdvisor;
 import org.jboss.aop.MethodInfo;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.advice.PerVmAdvice;
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.joinpoint.InvocationResponse;
 import org.jboss.aop.util.MethodHashing;
@@ -62,13 +57,10 @@
 import org.jboss.ejb3.annotation.LocalBinding;
 import org.jboss.ejb3.annotation.RemoteBinding;
 import org.jboss.ejb3.annotation.RemoteBindings;
-import org.jboss.ejb3.aop.LifeCycleInvocation;
 import org.jboss.ejb3.cache.CacheFactoryRegistry;
 import org.jboss.ejb3.cache.Ejb3CacheFactory;
 import org.jboss.ejb3.cache.StatefulCache;
 import org.jboss.ejb3.cache.StatefulObjectFactory;
-import org.jboss.ejb3.interceptors.aop.InterceptorsFactory;
-import org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor;
 import org.jboss.ejb3.proxy.ProxyFactory;
 import org.jboss.ejb3.proxy.ProxyUtils;
 import org.jboss.ejb3.proxy.factory.ProxyFactoryHelper;
@@ -564,41 +556,14 @@
             }
          }
       }
-      // FIXME: this is just a hack, use an interceptor stack
-      try
-      {
-         List<Interceptor> interceptors = new ArrayList<Interceptor>(InterceptorsFactory.getLifeCycleInterceptors((InstanceAdvisor) getAdvisor(), PostActivate.class));
-         interceptors.add(0, PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup"));
-         
-         LifeCycleInvocation invocation = new LifeCycleInvocation(interceptors.toArray(new Interceptor[0]));
-         invocation.setAdvisor(getAdvisor());
-         invocation.setTargetObject(beanContext.getInstance());
-         invocation.invokeNext();
-      }
-      catch(Throwable t)
-      {
-         throw new RuntimeException(t);
-      }
+      
+      this.invokeCallback(beanContext, PostActivate.class);
    }
 
    @Override
    public void invokePrePassivate(BeanContext beanContext)
    {
-      // FIXME: this is just a hack, use an interceptor stack
-      try
-      {
-         List<Interceptor> interceptors = new ArrayList<Interceptor>(InterceptorsFactory.getLifeCycleInterceptors((InstanceAdvisor) getAdvisor(), PrePassivate.class));
-         interceptors.add(0, PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup"));
-         
-         LifeCycleInvocation invocation = new LifeCycleInvocation(interceptors.toArray(new Interceptor[0]));
-         invocation.setAdvisor(getAdvisor());
-         invocation.setTargetObject(beanContext.getInstance());
-         invocation.invokeNext();
-      }
-      catch(Throwable t)
-      {
-         throw new RuntimeException(t);
-      }
+      this.invokeCallback(beanContext, PrePassivate.class);
    }
 
    /*




More information about the jboss-cvs-commits mailing list