User: docodan 
  Date: 01/06/03 11:48:12

  Modified:    src/main/org/jboss/ejb Application.java Container.java
                        EntityContainer.java StatefulSessionContainer.java
                        StatelessSessionContainer.java
  Log:
  Incremental check-in towards making local interfaces "live."
  
  Revision  Changes    Path
  1.9       +14 -1     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Application.java  2001/02/21 06:20:09     1.8
  +++ Application.java  2001/06/03 18:48:12     1.9
  @@ -11,6 +11,8 @@
   import java.util.Collection;
   import java.util.HashMap;
   
  +import javax.ejb.EJBLocalHome;
  +
   import org.jboss.util.Service;
   
   /**
  @@ -20,7 +22,7 @@
    *   @see Container
    *   @see ContainerFactory
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.8 $
  + *   @version $Revision: 1.9 $
    */
   public class Application
        implements Service
  @@ -31,6 +33,7 @@
      
      // stores the containers for this application unit
      HashMap containers = new HashMap();
  +   HashMap localHomes = new HashMap();
      
      // class loader of this application
      ClassLoader classLoader = null;
  @@ -66,6 +69,16 @@
      public void removeContainer(Container con)
      {
         containers.remove(con.getBeanMetaData().getEjbName());
  +   }
  +   
  +   public void addLocalHome( Container con, EJBLocalHome localHome )
  +   {
  +      localHomes.put( con.getBeanMetaData().getEjbName(), localHome );
  +   }
  +   
  +   public void removeLocalHome( Container con )
  +   {
  +      localHomes.remove( con.getBeanMetaData().getEjbName() );
      }
      
   
  
  
  
  1.40      +34 -1     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.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Container.java    2001/05/23 18:23:20     1.39
  +++ Container.java    2001/06/03 18:48:12     1.40
  @@ -53,6 +53,8 @@
   import org.jnp.interfaces.java.javaURLContextFactory;
   import org.jnp.server.NamingServer;
   
  +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
  @@ -67,7 +69,7 @@
    *   @see ContainerFactory
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
  - *   @version $Revision: 1.39 $
  + *   @version $Revision: 1.40 $
    */
   public abstract class Container
   {
  @@ -104,12 +106,31 @@
   
      /** The custom security proxy used by the SecurityInterceptor */
      protected Object securityProxy;
  +   
  +   protected LocalContainerInvoker localContainerInvoker = 
  +      new BaseLocalContainerInvoker();
   
      // This is a cache for method permissions
      private HashMap methodPermissionsCache = new HashMap();
   
  +   protected Class localHomeInterface;
  +   
  +   protected Class localInterface;
  +
  +   
      // Public --------------------------------------------------------
   
  +   public Class getLocalClass() 
  +   {
  +      return localInterface;
  +   }
  +   
  +   public Class getLocalHomeClass() 
  +   {
  +      return localHomeInterface;
  +   }
  +   
  +   
      /**
      * Sets a transaction manager for this container.
      *
  @@ -294,6 +315,14 @@
         // Acquire classes from CL
         beanClass = classLoader.loadClass(metaData.getEjbClass());
   
  +      if (metaData.getHome() != null)
  +         localHomeInterface = classLoader.loadClass(metaData.getLocalHome());
  +      if (metaData.getRemote() != null)
  +         localInterface = classLoader.loadClass(metaData.getLocal());
  +      
  +      localContainerInvoker.setContainer( this );
  +      localContainerInvoker.init();
  +      application.addLocalHome(this, localContainerInvoker.getEJBLocalHome() );
         // Setup "java:" namespace
         setupEnvironment();
      }
  @@ -308,6 +337,7 @@
      public void start()
      throws Exception
      {
  +      localContainerInvoker.start();
      }
   
      /**
  @@ -317,6 +347,7 @@
      */
      public void stop()
      {
  +      localContainerInvoker.stop();
      }
   
      /**
  @@ -326,6 +357,8 @@
      */
      public void destroy()
      {
  +      localContainerInvoker.destroy();
  +      application.removeLocalHome( this );
      }
   
      /**
  
  
  
  1.37      +2 -21     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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- EntityContainer.java      2001/06/02 19:30:27     1.36
  +++ EntityContainer.java      2001/06/03 18:48:12     1.37
  @@ -37,7 +37,7 @@
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
   *   @author Daniel OConnor ([EMAIL PROTECTED])
  -*   @version $Revision: 1.36 $
  +*   @version $Revision: 1.37 $
   */
   public class EntityContainer
   extends Container
  @@ -53,10 +53,6 @@
      // This is the Remote interface class
      protected Class remoteInterface;
      
  -   protected Class localHomeInterface;
  -   
  -   protected Class localInterface;
  -
      // These are the mappings between the home interface methods and the container 
methods
      protected Map homeMapping;
   
  @@ -168,19 +164,8 @@
      public Class getRemoteClass()
      {
         return remoteInterface;
  -   }
  -   
  -   public Class getLocalClass() 
  -   {
  -      return localInterface;
      }
  -   
  -   public Class getLocalHomeClass() 
  -   {
  -      return localHomeInterface;
  -   }
  -   
  -
  + 
      // Container implementation --------------------------------------
      public void init()
      throws Exception
  @@ -194,10 +179,6 @@
            homeInterface = classLoader.loadClass(metaData.getHome());
         if (metaData.getRemote() != null)
            remoteInterface = classLoader.loadClass(metaData.getRemote());
  -      /*if (metaData.getHome() != null)
  -         localHomeInterface = classLoader.loadClass(metaData.getLocalHome());
  -      if (metaData.getRemote() != null)
  -         localInterface = classLoader.loadClass(metaData.getLocal());*/
   
         // Call default init
         super.init();
  
  
  
  1.23      +1 -15     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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StatefulSessionContainer.java     2001/06/02 19:30:27     1.22
  +++ StatefulSessionContainer.java     2001/06/03 18:48:12     1.23
  @@ -33,7 +33,7 @@
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author Daniel OConnor ([EMAIL PROTECTED])
  - *   @version $Revision: 1.22 $
  + *   @version $Revision: 1.23 $
    */
   public class StatefulSessionContainer
      extends Container
  @@ -48,10 +48,6 @@
      // This is the Remote interface class
      protected Class remoteInterface;
   
  -   protected Class localHomeInterface;
  -   
  -   protected Class localInterface;
  -
      // These are the mappings between the home interface methods and the container 
methods
      protected Map homeMapping;
      
  @@ -160,17 +156,7 @@
         return remoteInterface;
      }
      
  -   public Class getLocalClass() 
  -   {
  -      return localInterface;
  -   }
  -   
  -   public Class getLocalHomeClass() 
  -   {
  -      return localHomeInterface;
  -   }
      
  -    
      // Container implementation --------------------------------------
      public void init()
         throws Exception
  
  
  
  1.17      +1 -15     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StatelessSessionContainer.java    2001/06/02 19:30:27     1.16
  +++ StatelessSessionContainer.java    2001/06/03 18:48:12     1.17
  @@ -30,7 +30,7 @@
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
   *   @author Daniel OConnor ([EMAIL PROTECTED])
  -*   @version $Revision: 1.16 $
  +*   @version $Revision: 1.17 $
   */
   public class StatelessSessionContainer
       extends Container
  @@ -45,10 +45,6 @@
       // This is the Remote interface class
       protected Class remoteInterface;
       
  -    protected Class localHomeInterface;
  -   
  -    protected Class localInterface;
  -
      // These are the mappings between the home interface methods and the container 
methods
       protected Map homeMapping;
       
  @@ -129,16 +125,6 @@
       {
          return remoteInterface;
       }
  -    
  -   public Class getLocalClass() 
  -   {
  -      return localInterface;
  -   }
  -   
  -   public Class getLocalHomeClass() 
  -   {
  -      return localHomeInterface;
  -   }
       
       
       // Container implementation --------------------------------------
  
  
  

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

Reply via email to