User: d_jencks
  Date: 01/11/14 21:30:55

  Modified:    src/main/org/jboss/ejb Application.java Container.java
                        EntityContainer.java MessageDrivenContainer.java
                        StatefulSessionContainer.java
                        StatelessSessionContainer.java
  Log:
  Fixed Application and rolled back changes on Container, EntityContainer, 
MessageDrivenContainer, StatefulSessionContainer, StatelessSessionContainer, and 
plugins/local/BaseLocalContainerInvoker. cmp 2 appears to work again.
  
  Revision  Changes    Path
  1.20      +11 -8     jboss/src/main/org/jboss/ejb/Application.java
  
  Index: Application.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Application.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Application.java  2001/11/12 06:52:16     1.19
  +++ Application.java  2001/11/15 05:30:54     1.20
  @@ -28,7 +28,7 @@
    * @see ContainerFactory
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  - * @version $Revision: 1.19 $
  + * @version $Revision: 1.20 $
    */
   public class Application
      implements Service
  @@ -193,10 +193,14 @@
       */
      public void start() throws Exception
      {
  -      Iterator enum = containers.values().iterator();
  -      while (enum.hasNext())
  +      for (Iterator i = containers.values().iterator(); i.hasNext();)
         {
  -         Container con = (Container)enum.next();
  +         Container con = (Container)i.next();
  +         con.init();        
  +      }
  +      for (Iterator i = containers.values().iterator(); i.hasNext();)
  +      {
  +         Container con = (Container)i.next();
            con.start();        
         }
      }
  @@ -206,11 +210,10 @@
       */
      public void stop()
      {
  -      Iterator enum = containers.values().iterator();
  -      while (enum.hasNext())
  +      for (Iterator i = containers.values().iterator(); i.hasNext();)
         {
  -         Container con = (Container)enum.next();
  -         con.stop();
  +         Container con = (Container)i.next();
  +         con.stop();        
         }
      }
        
  
  
  
  1.60      +26 -81    jboss/src/main/org/jboss/ejb/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Container.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Container.java    2001/11/12 06:52:16     1.59
  +++ Container.java    2001/11/15 05:30:54     1.60
  @@ -6,17 +6,14 @@
    */
   package org.jboss.ejb;
   
  -
  -
  -
  -
  -
   import java.lang.reflect.Method;
  -import java.net.MalformedURLException;
  +
   import java.net.URL;
  -import java.util.HashMap;
  +import java.net.MalformedURLException;
   import java.util.Iterator;
  +import java.util.HashMap;
   import java.util.Set;
  +
   import javax.management.Attribute;
   import javax.management.AttributeList;
   import javax.management.AttributeNotFoundException;
  @@ -29,33 +26,34 @@
   import javax.management.MBeanOperationInfo;
   import javax.management.MBeanParameterInfo;
   import javax.management.MBeanServer;
  -import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
   import javax.naming.Context;
  +import javax.naming.Name;
   import javax.naming.InitialContext;
   import javax.naming.LinkRef;
  -import javax.naming.Name;
  -import javax.naming.NameNotFoundException;
  -import javax.naming.NamingException;
  -import javax.naming.RefAddr;
   import javax.naming.Reference;
  +import javax.naming.NamingException;
   import javax.naming.StringRefAddr;
  +import javax.naming.RefAddr;
  +import javax.naming.NameNotFoundException;
   import javax.transaction.TransactionManager;
  -import org.jboss.deployment.DeploymentException;
  +
  +
   import org.jboss.ejb.BeanLockManager;
  -import org.jboss.ejb.plugins.local.BaseLocalContainerInvoker;
   import org.jboss.logging.Logger;
  -import org.jboss.metadata.ApplicationMetaData;
   import org.jboss.metadata.BeanMetaData;
  -import org.jboss.metadata.EjbLocalRefMetaData;
  -import org.jboss.metadata.EjbRefMetaData;
   import org.jboss.metadata.EnvEntryMetaData;
  -import org.jboss.metadata.ResourceEnvRefMetaData;
  +import org.jboss.metadata.EjbRefMetaData;
  +import org.jboss.metadata.EjbLocalRefMetaData;
   import org.jboss.metadata.ResourceRefMetaData;
  +import org.jboss.metadata.ResourceEnvRefMetaData;
  +import org.jboss.metadata.ApplicationMetaData;
   import org.jboss.security.EJBSecurityManager;
   import org.jboss.security.RealmMapping;
   
  +import org.jboss.ejb.plugins.local.BaseLocalContainerInvoker;
  +
   /**
    * This is the base class for all EJB-containers in JBoss. A Container
    * functions as the central hub of all metadata and plugins. Through this
  @@ -74,7 +72,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
    * @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
  - * @version $Revision: 1.59 $
  + * @version $Revision: 1.60 $
    *
    * <p><b>Revisions:</b>
    *
  @@ -90,7 +88,6 @@
   public abstract class Container implements DynamicMBean
   {
      // Constants -----------------------------------------------------
  -   private static final String SERVICE_CONTROLLER_NAME = 
"JBOSS-SYSTEM:spine=ServiceController";
   
      // Attributes ----------------------------------------------------
   
  @@ -378,7 +375,7 @@
       *                      (ClassNotFoundException) or setting up "java:"
       *                      naming environment failed (DeploymentException)
       */
  -   /*public void init() throws Exception
  +   public void init() throws Exception
      {
         // Acquire classes from CL
         beanClass = classLoader.loadClass(metaData.getEjbClass());
  @@ -394,7 +391,7 @@
            application.addLocalHome(this, localContainerInvoker.getEJBLocalHome() );
         // Setup "java:comp/env" namespace
         setupEnvironment();
  -      }*/
  +   }
   
      /**
       * A default implementation of starting the container service.
  @@ -411,27 +408,10 @@
      public void start()
         throws Exception
      {
  -      // Acquire classes from CL
  -      beanClass = classLoader.loadClass(metaData.getEjbClass());
  -
  -      if (metaData.getLocalHome() != null)
  -         localHomeInterface = classLoader.loadClass(metaData.getLocalHome());
  -      if (metaData.getLocal() != null)
  -         localInterface = classLoader.loadClass(metaData.getLocal());
  -      
  -      localContainerInvoker.setContainer( this );
  -      //localContainerInvoker.init();
  -      if (localHomeInterface != null)
  -         application.addLocalHome(this, localContainerInvoker.getEJBLocalHome() );
  -      // Setup "java:comp/env" namespace
  -      setupEnvironment();
         localContainerInvoker.start();
  -      ObjectName jmxName = getObjectName();
  +      String jndiName = this.getBeanMetaData().getJndiName();
  +      ObjectName jmxName = new ObjectName("J2EE:service=EJB,jndiName="+jndiName);
         mbeanServer.registerMBean(this, jmxName);
  -      mbeanServer.invoke(getServiceControllerName(),
  -                           "registerAndStartService",
  -                           new Object[] {jmxName, null},
  -                           new String[] {"javax.management.ObjectName", 
"java.lang.String"});
      }
   
      /**
  @@ -444,15 +424,9 @@
         localContainerInvoker.stop();
         try
         {
  -         ObjectName jmxName = getObjectName();
  -         //  localContainerInvoker.destroy();
  -         //mbeanServer.unregisterMBean(jmxName);
  -         mbeanServer.invoke(getServiceControllerName(),
  -                 "undeploy",
  -                 new Object[] {jmxName},
  -                 new String[] {"javax.management.ObjectName"});
  -         application.removeLocalHome( this );//???order??after undeploy?
  -
  +         String jndiName = this.getBeanMetaData().getJndiName();
  +         ObjectName jmxName = new ObjectName("J2EE:service=EJB,jndiName="+jndiName);
  +         mbeanServer.unregisterMBean(jmxName);
         }
         catch(Exception e)
         {
  @@ -464,12 +438,11 @@
       * The concrete container classes should override this method to introduce
       * implementation specific destroy behaviour.
       */
  -   /*
      public void destroy()
      {
  -      //localContainerInvoker.destroy();
  -      //application.removeLocalHome( this );
  -      }*/
  +      localContainerInvoker.destroy();
  +      application.removeLocalHome( this );
  +   }
   
      /**
       * This method is called by the ContainerInvoker when a method call comes
  @@ -897,32 +870,4 @@
   
         ctx.bind(n.get(0), val);
      }
  -
  -   private ObjectName getObjectName() throws DeploymentException
  -   {
  -      try 
  -      {
  -      String jndiName = this.getBeanMetaData().getJndiName();
  -      return new ObjectName("J2EE:service=EJB,jndiName="+jndiName);
  -      } 
  -      catch (MalformedObjectNameException mone) 
  -      {
  -         throw new DeploymentException("Can't construct container object name!!" + 
mone);
  -       } // end of try-catch
  -      
  -   }
  -
  -
  -   protected ObjectName getServiceControllerName() throws DeploymentException
  -   {
  -      try 
  -      {
  -         return new ObjectName(SERVICE_CONTROLLER_NAME);
  -      }
  -      catch(MalformedObjectNameException mone)
  -      {
  -         throw new DeploymentException("Can't construct service controller object 
name!!" + mone);
  -      }
  -   }
  -
   }
  
  
  
  1.56      +11 -85    jboss/src/main/org/jboss/ejb/EntityContainer.java
  
  Index: EntityContainer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- EntityContainer.java      2001/11/12 06:52:16     1.55
  +++ EntityContainer.java      2001/11/15 05:30:54     1.56
  @@ -46,7 +46,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel OConnor</a>
    * @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Andreas Schaefer</a>
  - * @version $Revision: 1.55 $
  + * @version $Revision: 1.56 $
    *
    * <p><b>Revisions:</b>
    *
  @@ -277,7 +277,7 @@
      }
   
      // Container implementation --------------------------------------
  -   /*
  +
      public void init() throws Exception
      {
         // Associate thread with classloader
  @@ -333,65 +333,15 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -*/
  +
      public void start() throws Exception
      {
         // Associate thread with classloader
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(getClassLoader());
   
  -      // Acquire classes from CL
  -      if (metaData.getHome() != null)
  -         homeInterface = classLoader.loadClass(metaData.getHome());
  -      if (metaData.getRemote() != null)
  -         remoteInterface = classLoader.loadClass(metaData.getRemote());
  -
  -      // Call default init
  -      super.start();
  -
  -      // Map the bean methods
  -      setupBeanMapping();
  -
  -      // Map the home methods
  -      setupHomeMapping();
  -
  -      // Initialize pool
  -      instancePool.init();
  -
  -      // Init container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.init();
  -
  -      // Init instance cache
  -      instanceCache.init();
  -
  -      // Init persistence
  -      persistenceManager.init();
  -
  -      // Initialize the interceptor by calling the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.setContainer(this);
  -         in.init();
  -      }
  -
  -      try
  -      {
  -         isModified = getBeanClass().getMethod("isModified", new Class[0]);
  -         if (!isModified.getReturnType().equals(Boolean.TYPE))
  -            isModified = null; // Has to have "boolean" as return type!
  -      }
  -      catch (NoSuchMethodException ignored) {}
  -
  -
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -
         // Call default start
  -      //super.start();
  +      super.start();
   
         // Start container invoker
         if (containerInvoker != null)
  @@ -407,9 +357,11 @@
         instancePool.start();
   
         // Start all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.start();
  +         in = in.getNext();
         }
   
         // Reset classloader
  @@ -439,43 +391,17 @@
         instancePool.stop();
   
         // Stop all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.stop();
  -      }
  -
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -
  -      // Call default destroy
  -      //super.destroy();
  -
  -      // Destroy container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.destroy();
  -
  -      // Destroy instance cache
  -      instanceCache.destroy();
  -
  -      // Destroy persistence
  -      persistenceManager.destroy();
  -
  -      // Destroy the pool
  -      instancePool.destroy();
  -
  -      // Destroy all the interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.destroy();
  +         in = in.getNext();
         }
   
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   /*
  +
      public void destroy()
      {
         // Associate thread with classloader
  @@ -509,7 +435,7 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   */
  +
      public Object invokeHome(MethodInvocation mi) throws Exception
      {
         return getInterceptor().invokeHome(mi);
  
  
  
  1.15      +14 -62    jboss/src/main/org/jboss/ejb/MessageDrivenContainer.java
  
  Index: MessageDrivenContainer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/MessageDrivenContainer.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MessageDrivenContainer.java       2001/11/12 06:52:16     1.14
  +++ MessageDrivenContainer.java       2001/11/15 05:30:54     1.15
  @@ -32,7 +32,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel OConnor</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public class MessageDrivenContainer
       extends Container
  @@ -144,7 +144,7 @@
       }
   
       // Container implementation - overridden here ----------------------
  -   /*
  +
       public void init() throws Exception
       {
           try {
  @@ -180,47 +180,16 @@
               throw e;
           }
       }
  -*/
  -   public void start()
  +
  +    public void start()
           throws Exception
       {
  -       ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -        try {
  -            // Associate thread with classloader
  -            Thread.currentThread().setContextClassLoader(getClassLoader());
  -
  -            // Call default init
  -            super.start();
  -
  -            // Map the bean methods
  -            setupBeanMapping();
  -
  -            // Initialize pool
  -            instancePool.init();
  -
  -            // Init container invoker
  -            containerInvoker.init();
  -
  -            // Initialize the interceptor by calling the chain
  -            for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -            {
  -                in.setContainer(this);
  -                in.init();
  -            }
  -
  -            // Reset classloader
  -            //Thread.currentThread().setContextClassLoader(oldCl);
  -        }
  -        catch (Exception e) {
  -            log.error("Serious error in init: ", e);
  -            throw e;
  -        }
           // Associate thread with classloader
  -        //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -        //Thread.currentThread().setContextClassLoader(getClassLoader());
  +        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  +        Thread.currentThread().setContextClassLoader(getClassLoader());
   
           // Call default start
  -        //super.start();
  +        super.start();
   
           // Start container invoker
           containerInvoker.start();
  @@ -228,9 +197,11 @@
           instancePool.start();
   
           // Start all interceptors in the chain
  -        for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +        Interceptor in = interceptor;
  +        while (in != null)
           {
              in.start();
  +           in = in.getNext();
           }
   
           // Reset classloader
  @@ -253,36 +224,17 @@
           instancePool.stop();
   
           // Stop all interceptors in the chain
  -        for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +        Interceptor in = interceptor;
  +        while (in != null)
           {
              in.stop();
  -        }
  -
  -        // Reset classloader
  -        //Thread.currentThread().setContextClassLoader(oldCl);
  -        // Associate thread with classloader
  -        //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -        //Thread.currentThread().setContextClassLoader(getClassLoader());
  -
  -        // Call default destroy
  -        //super.destroy();
  -
  -        // Destroy container invoker
  -        containerInvoker.destroy();
  -
  -        // Destroy the pool
  -        instancePool.destroy();
  -
  -        // Destroy all the interceptors in the chain
  -        for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -        {
  -           in.destroy();
  +           in = in.getNext();
           }
   
           // Reset classloader
           Thread.currentThread().setContextClassLoader(oldCl);
       }
  -   /*
  +
       public void destroy()
       {
           // Associate thread with classloader
  @@ -309,7 +261,7 @@
           // Reset classloader
           Thread.currentThread().setContextClassLoader(oldCl);
       }
  -*/
  +
   
       public Object invokeHome(MethodInvocation mi)
           throws Exception
  
  
  
  1.37      +12 -77    jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java
  
  Index: StatefulSessionContainer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- StatefulSessionContainer.java     2001/11/12 06:52:16     1.36
  +++ StatefulSessionContainer.java     2001/11/15 05:30:54     1.37
  @@ -34,7 +34,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel OConnor</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.36 $
  + * @version $Revision: 1.37 $
    *
    * <p><b>Revisions</b>
    * <p><b>20010704</b>
  @@ -182,7 +182,7 @@
      }
      
      // Container implementation --------------------------------------
  -   /*
  +   
      public void init() throws Exception
      {
         // Associate thread with classloader
  @@ -229,56 +229,15 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   */
  -   //remove the init calls another day.
  +   
      public void start() throws Exception
      {
  +      // Associate thread with classloader
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(getClassLoader());
         
  -      // Acquire classes from CL
  -      if (metaData.getHome() != null)
  -         homeInterface = classLoader.loadClass(metaData.getHome());
  -      if (metaData.getRemote() != null)
  -         remoteInterface = classLoader.loadClass(metaData.getRemote());
  -      
  -      // Call default init
  -      super.start();
  -      
  -      // Map the bean methods
  -      setupBeanMapping();
  -      
  -      // Map the home methods
  -      setupHomeMapping();
  -      
  -      // Init container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.init();
  -      
  -      // Init instance cache
  -      instanceCache.init();
  -      
  -      // Initialize pool
  -      instancePool.init();
  -      
  -      // Init persistence
  -      persistenceManager.init();
  -      
  -      // Initialize the interceptor by calling the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.setContainer(this);
  -         in.init();
  -      }
  -      
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      // ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -      
         // Call default start
  -      //super.start();
  +      super.start();
         
         // Start container invoker
         if (containerInvoker != null)
  @@ -294,9 +253,11 @@
         persistenceManager.start();
         
         // Start all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.start();
  +         in = in.getNext();
         }
         
         // Reset classloader
  @@ -329,43 +290,17 @@
         instancePool.stop();
         
         // Stop all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.stop();
  -      }
  -      
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -      
  -      // Call default destroy
  -      //super.destroy();
  -      
  -      // Destroy container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.destroy();
  -      
  -      // Destroy instance cache
  -      instanceCache.destroy();
  -      
  -      // Destroy pool
  -      instancePool.destroy();
  -      
  -      // Destroy persistence
  -      persistenceManager.destroy();
  -      
  -      // Destroy all the interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.destroy();
  +         in = in.getNext();
         }
         
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   /*
  +   
      public void destroy()
      {
         // Associate thread with classloader
  @@ -399,7 +334,7 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   */
  +   
      public Object invokeHome(MethodInvocation mi)
      throws Exception
      {
  
  
  
  1.28      +11 -65    jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java
  
  Index: StatelessSessionContainer.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- StatelessSessionContainer.java    2001/11/12 06:52:16     1.27
  +++ StatelessSessionContainer.java    2001/11/15 05:30:54     1.28
  @@ -30,7 +30,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel OConnor</a>
  - * @version $Revision: 1.27 $
  + * @version $Revision: 1.28 $
    */
   public class StatelessSessionContainer
      extends Container
  @@ -137,7 +137,7 @@
   
   
      // Container implementation --------------------------------------
  -   /*
  +
      public void init() throws Exception
      {
         // Associate thread with classloader
  @@ -178,51 +178,15 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   */
  +
      public void start() throws Exception
      {
         // Associate thread with classloader
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(getClassLoader());
   
  -      // Acquire classes from CL
  -      if (metaData.getHome() != null)
  -         homeInterface = classLoader.loadClass(metaData.getHome());
  -      if (metaData.getRemote() != null)
  -         remoteInterface = classLoader.loadClass(metaData.getRemote());
  -
  -      // Call default init
  -      super.start();
  -
  -      // Map the bean methods
  -      setupBeanMapping();
  -
  -      // Map the home methods
  -      setupHomeMapping();
  -
  -      // Initialize pool
  -      instancePool.init();
  -
  -      // Init container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.init();
  -
  -      // Initialize the interceptor by calling the chain
  -      
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.setContainer(this);
  -         in.init();
  -      }
  -      
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -
         // Call default start
  -      //super.start();
  +      super.start();
   
         // Start container invoker
         if (containerInvoker != null)
  @@ -232,9 +196,11 @@
         instancePool.start();
   
         // Start all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.start();
  +         in = in.getNext();
         }
   
         // Reset classloader
  @@ -258,37 +224,17 @@
         instancePool.stop();
   
         // Stop all interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  +      Interceptor in = interceptor;
  +      while (in != null)
         {
            in.stop();
  -      }
  -
  -      // Reset classloader
  -      //Thread.currentThread().setContextClassLoader(oldCl);
  -      // Associate thread with classloader
  -      //ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  -      //Thread.currentThread().setContextClassLoader(getClassLoader());
  -
  -      // Call default destroy
  -      //super.destroy();
  -
  -      // Destroy container invoker
  -      if (containerInvoker != null)
  -         containerInvoker.destroy();
  -
  -      // Destroy the pool
  -      instancePool.destroy();
  -
  -      // Destroy all the interceptors in the chain
  -      for (Interceptor in = interceptor; in != null; in = in.getNext()) 
  -      {
  -         in.destroy();
  +         in = in.getNext();
         }
   
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   /*
  +
      public void destroy()
      {
         // Associate thread with classloader
  @@ -316,7 +262,7 @@
         // Reset classloader
         Thread.currentThread().setContextClassLoader(oldCl);
      }
  -   */
  +
      public Object invokeHome(MethodInvocation mi) throws Exception
      {
         return getInterceptor().invokeHome(mi);
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to