dain        2004/04/03 20:49:10

  Modified:    modules/core/src/java/org/openejb/entity/cmp
                        CMPContainerBuilder.java
  Log:

  Added deployment support for Stateful and BMP beans
  Fixed more serialization problems
  Added ContainerBuilder interface
  
  Revision  Changes    Path
  1.3       +11 -20    
openejb/modules/core/src/java/org/openejb/entity/cmp/CMPContainerBuilder.java
  
  Index: CMPContainerBuilder.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/CMPContainerBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CMPContainerBuilder.java  22 Mar 2004 00:41:19 -0000      1.2
  +++ CMPContainerBuilder.java  4 Apr 2004 01:49:10 -0000       1.3
  @@ -56,24 +56,22 @@
   
   import org.openejb.AbstractContainerBuilder;
   import org.openejb.EJBComponentType;
  -import org.openejb.EJBContainer;
  -import org.openejb.GenericEJBContainer;
   import org.openejb.InstanceContextFactory;
   import org.openejb.InterceptorBuilder;
   import org.openejb.cache.InstancePool;
  -import org.openejb.dispatch.MethodSignature;
  -import org.openejb.dispatch.VirtualOperation;
   import org.openejb.dispatch.InterfaceMethodSignature;
   import org.openejb.dispatch.MethodHelper;
  +import org.openejb.dispatch.MethodSignature;
  +import org.openejb.dispatch.VirtualOperation;
   import org.openejb.entity.BusinessMethod;
   import org.openejb.entity.EntityInstanceFactory;
   import org.openejb.entity.EntityInterceptorBuilder;
   import org.openejb.entity.HomeMethod;
   import org.openejb.proxy.EJBProxyFactory;
   import org.tranql.cache.CacheTable;
  +import org.tranql.field.FieldTransform;
   import org.tranql.identity.IdentityTransform;
   import org.tranql.query.QueryCommand;
  -import org.tranql.field.FieldTransform;
   
   /**
    *
  @@ -92,7 +90,7 @@
           return EJBComponentType.CMP_ENTITY;
       }
   
  -    public EJBContainer createContainer() throws Exception {
  +    protected Object buildIt(boolean buildContainer) throws Exception {
           // stuff we still need
           String[] cmpFields = null;
           String[] relations = null;
  @@ -102,8 +100,7 @@
           FieldTransform[] relationTransforms = null;
   
           // get the bean class
  -        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
  -        Class beanClass = classLoader.loadClass(getBeanClassName());
  +        Class beanClass = getClassLoader().loadClass(getBeanClassName());
   
           // build the vop table
           LinkedHashMap vopMap = buildVopMap(beanClass);
  @@ -123,17 +120,11 @@
           // build the pool
           InstancePool pool = createInstancePool(instanceFactory);
   
  -        // construct the container
  -        return new GenericEJBContainer(
  -                getContainerId(),
  -                getEJBName(),
  -                proxyFactory,
  -                signatures,
  -                interceptorBuilder,
  -                pool,
  -                getUserTransaction(),
  -                getTransactionManager(),
  -                getTrackedConnectionAssociator());
  +        if (buildContainer) {
  +            return createContainer(proxyFactory, signatures, interceptorBuilder, 
pool);
  +        } else {
  +            return createConfiguration(proxyFactory, signatures, 
interceptorBuilder, pool);
  +        }
       }
   
       private Map buildInstanceMap(Class beanClass, String[] cmpFields, 
FieldTransform[] cmpFieldTransforms, String[] relations, FieldTransform[] 
relationTransforms, MethodSignature[] queries, QueryCommand[][] queryCommands) {
  
  
  

Reply via email to