dain        2004/04/06 14:41:45

  Modified:    modules/core/src/java/org/openejb
                        AbstractContainerBuilder.java ContainerIndex.java
                        GenericEJBContainer.java
  Log:

  Added an assembly module
  Fixed remaining not serializable bugs
  Added configuration files for itests to deploy into new assembly
  
  Revision  Changes    Path
  1.5       +3 -7      
openejb/modules/core/src/java/org/openejb/AbstractContainerBuilder.java
  
  Index: AbstractContainerBuilder.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/AbstractContainerBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractContainerBuilder.java     6 Apr 2004 00:43:06 -0000       1.4
  +++ AbstractContainerBuilder.java     6 Apr 2004 18:41:45 -0000       1.5
  @@ -93,11 +93,7 @@
       private TrackedConnectionAssociator trackedConnectionAssociator;
   
       public ClassLoader getClassLoader() {
  -        if(classLoader != null) {
  -            return classLoader;
  -        } else {
  -            return Thread.currentThread().getContextClassLoader();
  -        }
  +        return classLoader;
       }
   
       public void setClassLoader(ClassLoader classLoader) {
  @@ -270,7 +266,7 @@
           return new SoftLimitedInstancePool(instanceFactory, 1);
       }
   
  -    protected abstract LinkedHashMap buildVopMap(Class beanClass);
  +    protected abstract LinkedHashMap buildVopMap(Class beanClass) throws Exception;
   
       private static Class loadOptionalClass(String className, ClassLoader 
classLoader) throws ClassNotFoundException {
           if (className == null) {
  
  
  
  1.3       +66 -31    openejb/modules/core/src/java/org/openejb/ContainerIndex.java
  
  Index: ContainerIndex.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/ContainerIndex.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContainerIndex.java       10 Mar 2004 09:20:17 -0000      1.2
  +++ ContainerIndex.java       6 Apr 2004 18:41:45 -0000       1.3
  @@ -45,6 +45,11 @@
   package org.openejb;
   
   import java.util.HashMap;
  +import java.util.Collection;
  +
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.ReferenceCollection;
   
   
   /**
  @@ -52,58 +57,88 @@
    * and more along the lines of a collection of containers registered as gbeans
    */
   public class ContainerIndex {
  -
  -
       // TODO: Should be an array list or something
  -    EJBContainer[] containers = new EJBContainer[1];
  -    
  -    HashMap index = new HashMap();
  +    private EJBContainer[] containers = new EJBContainer[1];
  +
  +    private final HashMap index = new HashMap();
   
       private static final ContainerIndex containerIndex = new ContainerIndex();
  -    
  -    public static ContainerIndex getInstance(){
  +
  +    private ReferenceCollection ejbContainers;
  +
  +    public static ContainerIndex getInstance() {
           return containerIndex;
       }
  -    
  -    private ContainerIndex(){}
   
  -    
  -    public void addContainer(EJBContainer container){
  +    private ContainerIndex() {
  +    }
  +
  +    public ContainerIndex(Collection ejbContainers) {
  +        this.ejbContainers = (ReferenceCollection) ejbContainers;
  +    }
  +
  +    public void addContainer(EJBContainer container) {
           int i = containers.length;
   
  -        EJBContainer[] newArray = new EJBContainer[i+1];
  +        EJBContainer[] newArray = new EJBContainer[i + 1];
           System.arraycopy(containers, 0, newArray, 0, i);
           containers = newArray;
  -        
  -        containers[i] =  container;
  -        index.put( container.getContainerID(), new Integer(i));
  +
  +        containers[i] = container;
  +        index.put(container.getContainerID(), new Integer(i));
       }
   
  -    public int length(){
  +    public int length() {
           return containers.length;
       }
   
  -    public int getContainerIndex(Object containerID){
  -        return getContainerIndex( (String)containerID);
  +    public int getContainerIndex(Object containerID) {
  +        return getContainerIndex((String) containerID);
       }
  -    
  -    public int getContainerIndex(String containerID){
  -        Integer idCode = (Integer)index.get( containerID );
  -        
  -        return ( idCode == null )? -1: idCode.intValue();
  +
  +    public int getContainerIndex(String containerID) {
  +        Integer idCode = (Integer) index.get(containerID);
  +
  +        return (idCode == null) ? -1 : idCode.intValue();
       }
  -    
  -    public EJBContainer getContainer(String containerID){
  +
  +    public EJBContainer getContainer(String containerID) {
           return getContainer(getContainerIndex(containerID));
       }
  -    
  -    public EJBContainer getContainer(Integer index){
  -        return (index == null)? null: getContainer(index.intValue());
  +
  +    public EJBContainer getContainer(Integer index) {
  +        return (index == null) ? null : getContainer(index.intValue());
       }
  -    
  -    public EJBContainer getContainer(int index){
  +
  +    public EJBContainer getContainer(int index) {
           return containers[index];
       }
  +
  +    public static final GBeanInfo GBEAN_INFO;
  +
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(ContainerIndex.class);
  +
  +        infoFactory.setConstructor(
  +                new String[]{ "ejbContainers" },
  +                new Class[]{ Collection.class });
  +
  +        infoFactory.addOperation("getContainerIndex", new Class[]{Object.class});
  +        infoFactory.addOperation("getContainerIndex", new Class[]{String.class});
  +        infoFactory.addOperation("getContainer", new Class[]{String.class});
  +        infoFactory.addOperation("getContainer", new Class[]{Integer.class});
  +        infoFactory.addOperation("getContainer", new Class[]{Integer.TYPE});
  +
  +        infoFactory.addReference("ejbContainers", EJBContainer.class);
  +
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
   }
   
   
  +
  
  
  
  1.5       +3 -4      
openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java
  
  Index: GenericEJBContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GenericEJBContainer.java  6 Apr 2004 00:43:06 -0000       1.4
  +++ GenericEJBContainer.java  6 Apr 2004 18:41:45 -0000       1.5
  @@ -59,21 +59,20 @@
   import javax.ejb.Handle;
   import javax.transaction.TransactionManager;
   
  -import org.apache.geronimo.transaction.TrackedConnectionAssociator;
   import org.apache.geronimo.core.service.Interceptor;
   import org.apache.geronimo.core.service.Invocation;
   import org.apache.geronimo.core.service.InvocationResult;
   import org.apache.geronimo.gbean.GBeanInfo;
   import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.transaction.TrackedConnectionAssociator;
  +import org.apache.geronimo.transaction.UserTransactionImpl;
   
   import org.openejb.cache.InstancePool;
   import org.openejb.client.EJBObjectHandler;
   import org.openejb.client.EJBObjectProxy;
   import org.openejb.dispatch.InterfaceMethodSignature;
  -import org.openejb.entity.EntityInterceptorBuilder;
   import org.openejb.proxy.EJBProxyFactory;
   import org.openejb.proxy.ProxyInfo;
  -import org.apache.geronimo.transaction.UserTransactionImpl;
   
   /**
    * @version $Revision$ $Date$
  
  
  

Reply via email to