geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context CMTInterceptor.java ExecutionContextInterceptor.java StatelessBMTInterceptor.java TransactionInterceptor.java
Date Fri, 15 Aug 2003 14:12:19 GMT
janb        2003/08/15 07:12:19

  Modified:    modules/core/src/java/org/apache/geronimo/ejb
                        CallbackInterceptor.java
                        EJBProxyFactoryManager.java EnterpriseContext.java
                        GeronimoSessionContext.java
                        SimpleEnterpriseContext.java
                        StatelessLifeCycleInterceptor.java
                        SynchronizationRegistry.java
               modules/core/src/java/org/apache/geronimo/ejb/cache
                        EnterpriseContextInstanceCache.java
                        EnterpriseContextInstancePool.java
                        StatefulInstanceInterceptor.java
                        StatefulSessionSynchronizationInterceptor.java
                        StatelessInstanceFactory.java
                        StatelessInstanceInterceptor.java
               modules/core/src/java/org/apache/geronimo/ejb/container
                        ContainerImpl.java EJBPlugins.java
               modules/core/src/java/org/apache/geronimo/ejb/context
                        CMTInterceptor.java
                        ExecutionContextInterceptor.java
                        StatelessBMTInterceptor.java
                        TransactionInterceptor.java
  Log:
  Refactored Container to RPCContainer and AbstractRPCContainer. Many classes in ejb package
required modification
  to use RPCContainer instead of Container - for now this is done with class casts, which
look messy, maybe theres
  a better way.
  
  Revision  Changes    Path
  1.4       +3 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/CallbackInterceptor.java
  
  Index: CallbackInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/CallbackInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CallbackInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ CallbackInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -62,6 +62,7 @@
   import org.apache.geronimo.common.AbstractInterceptor;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.SimpleInvocationResult;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -88,7 +89,7 @@
           }
   
           // Method metadata
  -        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(getContainer());
  +        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata((RPCContainer)getContainer());
           Method interfaceMethod = EJBInvocationUtil.getMethod(invocation);
           MethodMetadata methodMetadata = ejbMetadata.getMethodMetadata(interfaceMethod);
   
  
  
  
  1.5       +6 -5      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/EJBProxyFactoryManager.java
  
  Index: EJBProxyFactoryManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/EJBProxyFactoryManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EJBProxyFactoryManager.java	13 Aug 2003 02:12:40 -0000	1.4
  +++ EJBProxyFactoryManager.java	15 Aug 2003 14:12:19 -0000	1.5
  @@ -61,6 +61,7 @@
   import javax.ejb.EJBException;
   
   import org.apache.geronimo.common.AbstractComponent;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
   /**
  @@ -75,25 +76,25 @@
   
   
       public void doStart() throws Exception {
  -        log.debug("Starting EJBProxyFactoryManager: ejbName=" + EJBPlugins.getEJBMetadata(getContainer()).getName());
  +        log.debug("Starting EJBProxyFactoryManager: ejbName=" + EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getName());
   
           // @todo This should be handled by startRecursive()
           for (Iterator iterator = proxies.keySet().iterator(); iterator.hasNext();) {
               String proxyName = (String) iterator.next();
               EJBProxyFactory ejbProxyFactory = getEJBProxyFactory(proxyName);
  -            log.debug("Starting EJBProxyFactory: proxyName=" + proxyName + " ejbName="
+ EJBPlugins.getEJBMetadata(getContainer()).getName());
  +            log.debug("Starting EJBProxyFactory: proxyName=" + proxyName + " ejbName="
+ EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getName());
               ejbProxyFactory.start();
           }
       }
   
       public void doStop() {
  -        log.debug("Stopping EJBProxyFactoryManager: ejbName=" + EJBPlugins.getEJBMetadata(getContainer()).getName());
  +        log.debug("Stopping EJBProxyFactoryManager: ejbName=" + EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getName());
    
           // @todo This will not work when this is a container, as children must be stopped
before stop() is called.
           for (Iterator iterator = proxies.keySet().iterator(); iterator.hasNext();) {
               String proxyName = (String) iterator.next();
               EJBProxyFactory ejbProxyFactory = getEJBProxyFactory(proxyName);
  -            log.debug("Stopping EJBProxyFactory: proxyName=" + proxyName + " ejbName="
+ EJBPlugins.getEJBMetadata(getContainer()).getName());
  +            log.debug("Stopping EJBProxyFactory: proxyName=" + proxyName + " ejbName="
+ EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getName());
               ejbProxyFactory.stop();
           }
       }
  
  
  
  1.3       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/EnterpriseContext.java
  
  Index: EnterpriseContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/EnterpriseContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EnterpriseContext.java	11 Aug 2003 17:59:11 -0000	1.2
  +++ EnterpriseContext.java	15 Aug 2003 14:12:19 -0000	1.3
  @@ -57,7 +57,7 @@
   
   import javax.ejb.EnterpriseBean;
   
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   
   /**
    *
  @@ -74,7 +74,7 @@
   
       void setId(Object id);
   
  -    Container getContainer();
  +    RPCContainer getContainer();
   
       EnterpriseBean getInstance();
   
  
  
  
  1.4       +4 -4      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/GeronimoSessionContext.java
  
  Index: GeronimoSessionContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/GeronimoSessionContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GeronimoSessionContext.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ GeronimoSessionContext.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -71,7 +71,7 @@
   import javax.transaction.UserTransaction;
   import javax.xml.rpc.handler.MessageContext;
   
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.context.GeronimoUserTransaction;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -83,12 +83,12 @@
    * @version $Revision$ $Date$
    */
   public class GeronimoSessionContext implements SessionContext {
  -    private final Container container;
  +    private final RPCContainer container;
       private final UserTransaction userTransaction;
       private final TransactionManager transactionManager;
   //    private String state;
   
  -    public GeronimoSessionContext(Container container) {
  +    public GeronimoSessionContext(RPCContainer container) {
           this.container = container;
           EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(container);
           transactionManager = EJBPlugins.getTransactionManager(container);
  
  
  
  1.4       +5 -5      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/SimpleEnterpriseContext.java
  
  Index: SimpleEnterpriseContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/SimpleEnterpriseContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleEnterpriseContext.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ SimpleEnterpriseContext.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -57,7 +57,7 @@
   
   import javax.ejb.EnterpriseBean;
   
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   
   /**
    *
  @@ -66,7 +66,7 @@
    * @version $Revision$ $Date$
    */
   public final class SimpleEnterpriseContext implements EnterpriseContext {
  -    private Container container;
  +    private RPCContainer container;
       private Object id;
       private EnterpriseBean instance;
       private boolean valid = false;
  @@ -80,11 +80,11 @@
           instance = null;
       }
   
  -    public Container getContainer() {
  +    public RPCContainer getContainer() {
           return container;
       }
   
  -    public void setContainer(Container container) {
  +    public void setContainer(RPCContainer container) {
           this.container = container;
       }
   
  
  
  
  1.4       +5 -4      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/StatelessLifeCycleInterceptor.java
  
  Index: StatelessLifeCycleInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/StatelessLifeCycleInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatelessLifeCycleInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ StatelessLifeCycleInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -62,6 +62,7 @@
   import org.apache.geronimo.common.AbstractInterceptor;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.SimpleInvocationResult;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -90,7 +91,7 @@
   
       public void start() throws Exception {
           super.start();
  -        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(getContainer());
  +        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata((RPCContainer)getContainer());
           Class homeInterface = ejbMetadata.getHomeInterface();
           if (homeInterface != null) {
               createRemote = homeInterface.getMethod("create", null);
  @@ -118,14 +119,14 @@
               // remove for a stateless bean does nothing
               return new SimpleInvocationResult();
           } else if (method.equals(createRemote)) {
  -            EJBProxyFactoryManager ejbProxyFactoryManager = EJBPlugins.getEJBProxyFactoryManager(getContainer());
  +            EJBProxyFactoryManager ejbProxyFactoryManager = EJBPlugins.getEJBProxyFactoryManager((RPCContainer)getContainer());
               EJBProxyFactory ejbProxyFactory = ejbProxyFactoryManager.getThreadEJBProxyFactory();
               if (ejbProxyFactory == null) {
                   throw new IllegalStateException("No remote proxy factory set");
               }
               return new SimpleInvocationResult(ejbProxyFactory.getEJBObject());
           } else if (method.equals(createLocal)) {
  -            EJBProxyFactoryManager ejbProxyFactoryManager = EJBPlugins.getEJBProxyFactoryManager(getContainer());
  +            EJBProxyFactoryManager ejbProxyFactoryManager = EJBPlugins.getEJBProxyFactoryManager((RPCContainer)getContainer());
               EJBProxyFactory ejbProxyFactory = ejbProxyFactoryManager.getEJBProxyFactory("local");
               if (ejbProxyFactory == null) {
                   throw new IllegalStateException("No local proxy factoy set");
  
  
  
  1.4       +9 -9      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/SynchronizationRegistry.java
  
  Index: SynchronizationRegistry.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/SynchronizationRegistry.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SynchronizationRegistry.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ SynchronizationRegistry.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -68,7 +68,7 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.context.ExecutionContext;
   import org.apache.geronimo.ejb.context.TxExecutionContext;
  @@ -130,7 +130,7 @@
   
       public void beginInvocation(EnterpriseContext ctx) throws Exception {
           Registry registry = getRegistry();
  -        Container container = ctx.getContainer();
  +        RPCContainer container = ctx.getContainer();
   
           // load if not valid
           if (!ctx.isValid()) {
  @@ -213,7 +213,7 @@
        * Gets the EnterpriseContext for the current transaction in the
        * specified container with the specified key.
        */
  -    public EnterpriseContext getContext(Container container, Object id) {
  +    public EnterpriseContext getContext(RPCContainer container, Object id) {
           Registry registry = getRegistry();
           ContextKey key = new ContextKey(container, id);
           return (EnterpriseContext) registry.getAssociatedMap().get(key);
  @@ -269,7 +269,7 @@
       }
   
       private void synchronizeEntity(Registry registry, EnterpriseContext ctx) throws Exception
{
  -        Container container = ctx.getContainer();
  +        RPCContainer container = ctx.getContainer();
           EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(container);
   
           // any one can mark the tx rollback at any time so check
  @@ -326,7 +326,7 @@
        */
       private void disassociateEntity(boolean rollback, Object id, EnterpriseContext ctx)
{
           // Get the container associated with this context
  -        Container container = ctx.getContainer();
  +        RPCContainer container = ctx.getContainer();
           EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(container);
   
           ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
  @@ -418,10 +418,10 @@
       }
   
       private final class ContextKey {
  -        private final Container container;
  +        private final RPCContainer container;
           private final Object id;
   
  -        public ContextKey(final Container container, final Object id) {
  +        public ContextKey(final RPCContainer container, final Object id) {
               if (container == null) {
                   throw new IllegalArgumentException("Container is null");
               }
  @@ -432,7 +432,7 @@
               this.id = id;
           }
   
  -        public Container getContainer() {
  +        public RPCContainer getContainer() {
               return container;
           }
   
  
  
  
  1.4       +5 -4      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EnterpriseContextInstanceCache.java
  
  Index: EnterpriseContextInstanceCache.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EnterpriseContextInstanceCache.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EnterpriseContextInstanceCache.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ EnterpriseContextInstanceCache.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -64,6 +64,7 @@
   import org.apache.geronimo.cache.LRURunner;
   import org.apache.geronimo.common.AbstractComponent;
   import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EnterpriseContext;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
  @@ -108,7 +109,7 @@
                   // create a new context
                   Container container = getContainer();
                   try {
  -                    ctx = (EnterpriseContext) EJBPlugins.getInstanceFactory(container).createInstance();
  +                    ctx = (EnterpriseContext) EJBPlugins.getInstanceFactory((RPCContainer)container).createInstance();
                   } catch (Exception e) {
                       throw new NoSuchObjectException("An error occured while getting a new
context");
                   }
  @@ -116,7 +117,7 @@
                   // set the id of the new context
                   ctx.setId(id);
   
  -                EJBPlugins.getPersistenceManager(container).activate(ctx);
  +                EJBPlugins.getPersistenceManager((RPCContainer)container).activate(ctx);
                   cache.putActive(id, ctx);
               }
           }
  @@ -281,7 +282,7 @@
           public void remove(Object key, Object value) {
               try {
                   EnterpriseContext context = (EnterpriseContext) value;
  -                EJBPlugins.getPersistenceManager(getContainer()).passivate(context);
  +                EJBPlugins.getPersistenceManager((RPCContainer)getContainer()).passivate(context);
               } catch (Throwable e) {
                   log.error("Could not passivate ejb: id=" + key, e);
               }
  
  
  
  1.5       +3 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EnterpriseContextInstancePool.java
  
  Index: EnterpriseContextInstancePool.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/EnterpriseContextInstancePool.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EnterpriseContextInstancePool.java	13 Aug 2003 02:12:40 -0000	1.4
  +++ EnterpriseContextInstancePool.java	15 Aug 2003 14:12:19 -0000	1.5
  @@ -65,6 +65,7 @@
   import org.apache.geronimo.cache.InstancePool;
   import org.apache.geronimo.cache.SimpleInstancePool;
   import org.apache.geronimo.common.AbstractComponent;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EnterpriseContext;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
  @@ -81,7 +82,7 @@
   
       public void doStart() throws Exception {
           if (pool==null)
  -            pool = new SimpleInstancePool(EJBPlugins.getInstanceFactory(getContainer()),
maxSize, hardLimit);
  +            pool = new SimpleInstancePool(EJBPlugins.getInstanceFactory((RPCContainer)getContainer()),
maxSize, hardLimit);
           if (discardQueue==null)
               discardQueue = new DiscardQueue();
           
  
  
  
  1.4       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulInstanceInterceptor.java
  
  Index: StatefulInstanceInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulInstanceInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatefulInstanceInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ StatefulInstanceInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -60,7 +60,7 @@
   import org.apache.geronimo.cache.InstanceCache;
   import org.apache.geronimo.cache.InstancePool;
   import org.apache.geronimo.common.AbstractInterceptor;
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  @@ -85,7 +85,7 @@
   
       public void start() throws Exception {
           super.start();
  -        Container container = getContainer();
  +        RPCContainer container = (RPCContainer)getContainer();
           lockDomain = EJBPlugins.getLockDomain(container);
           pool = EJBPlugins.getInstancePool(container);
           cache = EJBPlugins.getInstanceCache(container);
  
  
  
  1.4       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulSessionSynchronizationInterceptor.java
  
  Index: StatefulSessionSynchronizationInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatefulSessionSynchronizationInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatefulSessionSynchronizationInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ StatefulSessionSynchronizationInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -67,7 +67,7 @@
   
   import org.apache.geronimo.cache.InstanceCache;
   import org.apache.geronimo.common.AbstractInterceptor;
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  @@ -91,7 +91,7 @@
   
       public void start() throws Exception {
           super.start();
  -        Container container = getContainer();
  +        RPCContainer container = (RPCContainer)getContainer();
           tm = EJBPlugins.getTransactionManager(container);
           cache = EJBPlugins.getInstanceCache(container);
           EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(container);
  
  
  
  1.4       +4 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceFactory.java
  
  Index: StatelessInstanceFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatelessInstanceFactory.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ StatelessInstanceFactory.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -62,6 +62,7 @@
   
   import org.apache.geronimo.cache.InstanceFactory;
   import org.apache.geronimo.common.AbstractComponent;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EnterpriseContext;
   import org.apache.geronimo.ejb.GeronimoSessionContext;
   import org.apache.geronimo.ejb.SimpleEnterpriseContext;
  @@ -79,7 +80,7 @@
   
       public void start() throws Exception {
           super.start();
  -        beanClass = EJBPlugins.getEJBMetadata(getContainer()).getBeanClass();
  +        beanClass = EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getBeanClass();
           ejbCreate = beanClass.getMethod("ejbCreate", null);
       }
   
  @@ -94,7 +95,7 @@
           SessionBean instance = (SessionBean) beanClass.newInstance();
   
           // initialize the instance
  -        instance.setSessionContext(new GeronimoSessionContext(getContainer()));
  +        instance.setSessionContext(new GeronimoSessionContext((RPCContainer)getContainer()));
           try {
               ejbCreate.invoke(instance, null);
           } catch (IllegalAccessException e) {
  
  
  
  1.4       +3 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceInterceptor.java
  
  Index: StatelessInstanceInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/cache/StatelessInstanceInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatelessInstanceInterceptor.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ StatelessInstanceInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -59,7 +59,7 @@
   
   import org.apache.geronimo.cache.InstancePool;
   import org.apache.geronimo.common.AbstractInterceptor;
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  @@ -79,7 +79,7 @@
   
       public void start() throws Exception {
           super.start();
  -        Container container = getContainer();
  +        RPCContainer container = (RPCContainer)getContainer();
           pool = EJBPlugins.getInstancePool(container);
       }
   
  
  
  
  1.6       +5 -157    incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/container/ContainerImpl.java
  
  Index: ContainerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/container/ContainerImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ContainerImpl.java	14 Aug 2003 07:14:34 -0000	1.5
  +++ ContainerImpl.java	15 Aug 2003 14:12:19 -0000	1.6
  @@ -55,19 +55,7 @@
    */
   package org.apache.geronimo.ejb.container;
   
  -import java.util.Iterator;
  -import java.util.LinkedHashMap;
  -import java.util.LinkedList;
  -import java.util.ListIterator;
  -import java.util.Map;
  -import javax.management.ObjectName;
  -
  -import org.apache.geronimo.common.AbstractContainer;
  -import org.apache.geronimo.common.Component;
  -import org.apache.geronimo.common.Interceptor;
  -import org.apache.geronimo.common.Invocation;
  -import org.apache.geronimo.common.InvocationResult;
  -import org.apache.geronimo.common.State;
  +import org.apache.geronimo.common.AbstractRPCContainer;
   
   /**
    *
  @@ -78,120 +66,10 @@
    * to an abstractContainer class
    * @version $Revision$ $Date$
    */
  -public class ContainerImpl extends AbstractContainer
  +public class ContainerImpl extends AbstractRPCContainer
   {
  -    private final Map plugins= new LinkedHashMap();
  -    private final Map pluginObjects= new LinkedHashMap();
  -    private final LinkedList interceptors= new LinkedList();
  -    // for efficency keep a reference to the first interceptor
  -    private Interceptor firstInterceptor;
  -
  -    public InvocationResult invoke(Invocation invocation) throws Exception
  -    {
  -        return firstInterceptor.invoke(invocation);
  -    }
  -
  -    public void addInterceptor(Interceptor interceptor)
  -    {
  -        if (firstInterceptor == null)
  -        {
  -            firstInterceptor= interceptor;
  -            interceptors.addLast(interceptor);
  -        }
  -        else
  -        {
  -            Interceptor lastInterceptor= (Interceptor)interceptors.getLast();
  -            lastInterceptor.setNext(interceptor);
  -            interceptors.addLast(interceptor);
  -        }
  -    }
  -
  -    public void startRecursive() throws Exception
  -    {
  -        try
  -        {
  -            // start this component
  -            setState(State.STARTING);
  -
  -            // Start all the components in forward insertion order
  -            for (Iterator iterator= pluginObjects.values().iterator(); iterator.hasNext();)
  -            {
  -                Object object= iterator.next();
  -                if (object instanceof Component)
  -                {
  -                    Component component= (Component)object;
  -                    component.startRecursive();
  -                }
  -            }
  -
  -            // Start this component
  -            doStart();
  -
  -            setState(State.RUNNING);
  -        }
  -        finally
  -        {
  -            if (getStateInstance() != State.RUNNING)
  -                setState(State.FAILED);
  -        }
  -    }
  -
  -    public void doStart() throws Exception
  -    {
  -        // Start all the plugins in forward insertion order
  -        for (Iterator iterator= interceptors.iterator(); iterator.hasNext();)
  -        {
  -            Interceptor interceptor= (Interceptor)iterator.next();
  -            interceptor.start();
  -        }
  -    }
  -
  -    public void stop()
  -    {
  -        try
  -        {
  -            setState(State.STOPPING);
  -
  -            // @todo this is actually a stopRecursive, which is not supported
  -            // by JSR77
  -            // Stop all the plugins in reverse insertion order
  -            LinkedList list= new LinkedList();
  -            for (Iterator iterator= pluginObjects.values().iterator(); iterator.hasNext();)
  -            {
  -                Object object= iterator.next();
  -                if (object instanceof Component)
  -                {
  -                    list.addFirst(object);
  -                }
  -            }
  -            for (Iterator iterator= list.iterator(); iterator.hasNext();)
  -            {
  -                Component component= (Component)iterator.next();
  -                component.stop();
  -            }
  -
  -            // Stop this component
  -            doStop();
  -
  -            setState(State.STOPPED);
  -        }
  -        finally
  -        {
  -            if (getStateInstance() != State.STOPPED)
  -                setState(State.FAILED);
  -        }
  -    }
  -
  -    public void doStop()
  -    {
  -        // Stop all the interceptors in reverse insertion order
  -        for (ListIterator iterator= interceptors.listIterator(interceptors.size()); iterator.hasPrevious();)
  -        {
  -            Interceptor interceptor= (Interceptor)iterator.previous();
  -            interceptor.stop();
  -        }
  -    }
  -
  +  
  + 
       // @todo destroy not supported in JSR77 lifecycle, needs to be
       // integrated or removed.
       public void destroy()
  @@ -200,35 +78,5 @@
           pluginObjects.clear();
       }
   
  -    public ObjectName getPlugin(String logicalPluginName)
  -    {
  -        return (ObjectName)plugins.get(logicalPluginName);
  -    }
  -
  -    public void putPlugin(String logicalPluginName, ObjectName objectName)
  -    {
  -        State state= getStateInstance();
  -        if (state != State.STOPPED)
  -        {
  -            throw new IllegalStateException(
  -                "putPluginObject can only be called while in the stopped state: state="
+ state);
  -        }
  -        plugins.put(logicalPluginName, objectName);
  -    }
   
  -    public Object getPluginObject(String logicalPluginName)
  -    {
  -        return pluginObjects.get(logicalPluginName);
  -    }
  -
  -    public void putPluginObject(String logicalPluginName, Object plugin)
  -    {
  -        State state= getStateInstance();
  -        if (state != State.STOPPED)
  -        {
  -            throw new IllegalStateException(
  -                "putPluginObject can only be called while in the not-created or destroyed
states: state=" + state);
  -        }
  -        pluginObjects.put(logicalPluginName, plugin);
  -    }
   }
  
  
  
  1.4       +18 -18    incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/container/EJBPlugins.java
  
  Index: EJBPlugins.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/container/EJBPlugins.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EJBPlugins.java	11 Aug 2003 17:59:11 -0000	1.3
  +++ EJBPlugins.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -60,7 +60,7 @@
   import org.apache.geronimo.cache.InstanceCache;
   import org.apache.geronimo.cache.InstanceFactory;
   import org.apache.geronimo.cache.InstancePool;
  -import org.apache.geronimo.common.Container;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EJBProxyFactoryManager;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
   import org.apache.geronimo.lock.LockDomain;
  @@ -85,67 +85,67 @@
       public static String PERSISTENCE_MANAGER = "Persustence Manager";
       public static String LOCK_DOMAIN = "Lock Domain";
   
  -    public static EJBProxyFactoryManager getEJBProxyFactoryManager(Container container)
{
  +    public static EJBProxyFactoryManager getEJBProxyFactoryManager(RPCContainer container)
{
           return (EJBProxyFactoryManager) container.getPluginObject(EJB_PROXY_FACTORY_MANAGER);
       }
   
  -    public static void putEJBProxyFactoryManager(Container container, EJBProxyFactoryManager
ejbProxyFactoryManager) {
  +    public static void putEJBProxyFactoryManager(RPCContainer container, EJBProxyFactoryManager
ejbProxyFactoryManager) {
           container.putPluginObject(EJB_PROXY_FACTORY_MANAGER, ejbProxyFactoryManager);
       }
   
  -    public static EJBMetadata getEJBMetadata(Container container) {
  +    public static EJBMetadata getEJBMetadata(RPCContainer container) {
           return (EJBMetadata) container.getPluginObject(EJB_METADATA);
       }
   
  -    public static void putEJBMetadata(Container container, EJBMetadata ejbMetadata) {
  +    public static void putEJBMetadata(RPCContainer container, EJBMetadata ejbMetadata)
{
           container.putPluginObject(EJB_METADATA, ejbMetadata);
       }
   
  -    public static TransactionManager getTransactionManager(Container container) {
  +    public static TransactionManager getTransactionManager(RPCContainer container) {
           return (TransactionManager) container.getPluginObject(TRANSACTION_MANAGER);
       }
   
  -    public static void putTransactionManager(Container container, TransactionManager transactionManager)
{
  +    public static void putTransactionManager(RPCContainer container, TransactionManager
transactionManager) {
           container.putPluginObject(TRANSACTION_MANAGER, transactionManager);
       }
   
  -    public static InstanceFactory getInstanceFactory(Container container) {
  +    public static InstanceFactory getInstanceFactory(RPCContainer container) {
           return (InstanceFactory) container.getPluginObject(EJB_CONTEXT_INSTANCE_FACTORY);
       }
   
  -    public static void putInstanceFactory(Container container, InstanceFactory instanceFactory)
{
  +    public static void putInstanceFactory(RPCContainer container, InstanceFactory instanceFactory)
{
           container.putPluginObject(EJB_CONTEXT_INSTANCE_FACTORY, instanceFactory);
       }
   
  -    public static InstancePool getInstancePool(Container container) {
  +    public static InstancePool getInstancePool(RPCContainer container) {
           return (InstancePool) container.getPluginObject(EJB_CONTEXT_INSTANCE_POOL);
       }
   
  -    public static void putInstancePool(Container container, InstancePool instancePool)
{
  +    public static void putInstancePool(RPCContainer container, InstancePool instancePool)
{
           container.putPluginObject(EJB_CONTEXT_INSTANCE_POOL, instancePool);
       }
   
  -    public static InstanceCache getInstanceCache(Container container) {
  +    public static InstanceCache getInstanceCache(RPCContainer container) {
           return (InstanceCache) container.getPluginObject(EJB_CONTEXT_INSTANCE_CACHE);
       }
   
  -    public static void putInstanceCache(Container container, InstanceCache instanceCache)
{
  +    public static void putInstanceCache(RPCContainer container, InstanceCache instanceCache)
{
           container.putPluginObject(EJB_CONTEXT_INSTANCE_CACHE, instanceCache);
       }
   
  -    public static PersistenceManager getPersistenceManager(Container container) {
  +    public static PersistenceManager getPersistenceManager(RPCContainer container) {
           return (PersistenceManager) container.getPluginObject(EJB_CONTEXT_INSTANCE_CACHE);
       }
   
  -    public static void putPersistenceManager(Container container, PersistenceManager persistenceManager)
{
  +    public static void putPersistenceManager(RPCContainer container, PersistenceManager
persistenceManager) {
           container.putPluginObject(EJB_CONTEXT_INSTANCE_CACHE, persistenceManager);
       }
   
  -    public static LockDomain getLockDomain(Container container) {
  +    public static LockDomain getLockDomain(RPCContainer container) {
           return (LockDomain) container.getPluginObject(LOCK_DOMAIN);
       }
   
  -    public static void putLockDomain(Container container, LockDomain lockDomain) {
  +    public static void putLockDomain(RPCContainer container, LockDomain lockDomain) {
           container.putPluginObject(LOCK_DOMAIN, lockDomain);
       }
   }
  
  
  
  1.4       +3 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/CMTInterceptor.java
  
  Index: CMTInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/CMTInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CMTInterceptor.java	11 Aug 2003 17:59:12 -0000	1.3
  +++ CMTInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -68,6 +68,7 @@
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.EJBInvocationUtil;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -86,7 +87,7 @@
   
       public void start() throws Exception {
           super.start();
  -        ejbMetadata = EJBPlugins.getEJBMetadata(getContainer());
  +        ejbMetadata = EJBPlugins.getEJBMetadata((RPCContainer)getContainer());
       }
   
       public void stop() {
  
  
  
  1.3       +3 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/ExecutionContextInterceptor.java
  
  Index: ExecutionContextInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/ExecutionContextInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExecutionContextInterceptor.java	11 Aug 2003 17:59:12 -0000	1.2
  +++ ExecutionContextInterceptor.java	15 Aug 2003 14:12:19 -0000	1.3
  @@ -62,6 +62,7 @@
   import org.apache.geronimo.common.AbstractInterceptor;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
   /**
  @@ -75,7 +76,7 @@
   
       public void start() throws Exception {
           super.start();
  -        tm = EJBPlugins.getTransactionManager(getContainer());
  +        tm = EJBPlugins.getTransactionManager((RPCContainer)getContainer());
       }
   
       public void stop() {
  
  
  
  1.4       +3 -2      incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatelessBMTInterceptor.java
  
  Index: StatelessBMTInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/StatelessBMTInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StatelessBMTInterceptor.java	11 Aug 2003 17:59:12 -0000	1.3
  +++ StatelessBMTInterceptor.java	15 Aug 2003 14:12:19 -0000	1.4
  @@ -64,6 +64,7 @@
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
   import org.apache.geronimo.common.InvocationType;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   
   /**
  @@ -77,7 +78,7 @@
   
       public void start() throws Exception {
           super.start();
  -        ejbName = EJBPlugins.getEJBMetadata(getContainer()).getName();
  +        ejbName = EJBPlugins.getEJBMetadata((RPCContainer)getContainer()).getName();
       }
   
       public InvocationResult invoke(Invocation invocation) throws Exception {
  
  
  
  1.6       +17 -2     incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/TransactionInterceptor.java
  
  Index: TransactionInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/context/TransactionInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TransactionInterceptor.java	14 Aug 2003 07:14:34 -0000	1.5
  +++ TransactionInterceptor.java	15 Aug 2003 14:12:19 -0000	1.6
  @@ -59,6 +59,7 @@
   import org.apache.geronimo.common.Interceptor;
   import org.apache.geronimo.common.Invocation;
   import org.apache.geronimo.common.InvocationResult;
  +import org.apache.geronimo.common.RPCContainer;
   import org.apache.geronimo.common.State;
   import org.apache.geronimo.ejb.container.EJBPlugins;
   import org.apache.geronimo.ejb.metadata.EJBMetadata;
  @@ -103,7 +104,7 @@
       }
   
       public void start() throws Exception {
  -        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata(container);
  +        EJBMetadata ejbMetadata = EJBPlugins.getEJBMetadata((RPCContainer)container);
           if (ejbMetadata.getTransactionDemarcation().isContainer()) {
               transactionInterceptor = new CMTInterceptor();
           } else {
  @@ -130,5 +131,19 @@
   
       public InvocationResult invoke(Invocation invocation) throws Exception {
           return transactionInterceptor.invoke(invocation);
  +    }
  +
  +
  +    /**
  +     * For compliance with Component interface.
  +     * NOTE: This Interceptor should probably implement
  +     * AbstractComponent!
  +     *
  +     * @todo need to return a decent name if Interceptors are Components
  +     * @return a <code>String</code> value
  +     */
  +    public String getObjectName ()
  +    {
  +        return null;
       }
   }
  
  
  

Mime
View raw message