[jboss-cvs] JBossAS SVN: r101655 - in projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi: deployment and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 1 08:50:22 EST 2010


Author: jaikiran
Date: 2010-03-01 08:50:21 -0500 (Mon, 01 Mar 2010)
New Revision: 101655

Added:
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EJB3Deployment.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EnterpriseDeployment.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/remote/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/remote/RemotingContainer.java
Modified:
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/BeanContext.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocation.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBContainer.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBDeploymentInfo.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBInstanceManager.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/InterceptorRegistry.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/EJBLifecycleHandler.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/StatefulEJBLifecycleHandler.java
Log:
EJBTHREE-2010 Container SPI (work in progress)

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/BeanContext.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/BeanContext.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/BeanContext.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -24,7 +24,6 @@
 import java.io.Serializable;
 
 /**
- * BeanContext
  * <p>
  *  A {@link BeanContext} holds the contextual information of a EJB instance
  * </p>

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocation.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocation.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocation.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -25,7 +25,6 @@
 import java.lang.reflect.Method;
 
 /**
- * ContainerInvocationContext
  * <p>
  * A {@link ContainerInvocation} represents an invocation to be processed by the {@link EJBContainer#invoke(ContainerInvocation)}
  * method. The {@link ContainerInvocation} holds the information about the method being invoked (on the bean proxy) and the

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBContainer.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBContainer.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBContainer.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -24,7 +24,6 @@
 import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
 
 /**
- * EJBContainer
  * 
  * Responsible for providing the necessary runtime infrastructure
  * for EJB3 enterprise beans. TODO: Needs more javadoc 

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBDeploymentInfo.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBDeploymentInfo.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBDeploymentInfo.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -24,8 +24,7 @@
 import java.net.URL;
 
 /**
- * EJBDeploymentInfo
- * 
+ *
  * Provides various deployment related information of a EJB deployment  
  *
  * TODO: This one needs more thinking

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBInstanceManager.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBInstanceManager.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBInstanceManager.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -24,7 +24,6 @@
 import java.io.Serializable;
 
 /**
- * EJBInstanceManager
  * <p>
  *  An {@link EJBInstanceManager} is responsible for creating/destroying bean
  *  instances.

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/InterceptorRegistry.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/InterceptorRegistry.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/InterceptorRegistry.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -21,14 +21,16 @@
 */
 package org.jboss.ejb3.container.spi;
 
+import java.util.List;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.ejb.PostActivate;
 import javax.ejb.PrePassivate;
+import javax.interceptor.Interceptors;
 
 /**
- * InterceptorRegistry
- *
+ * 
  * <p>
  * An {@link InterceptorRegistry} for a {@link EJBContainer} is responsible 
  * for applying any applicable interceptors to a target EJB instance during a 
@@ -127,4 +129,25 @@
     */
    Object intercept(ContainerInvocation containerInvocation, BeanContext targetBeanContext) throws Exception;
    
+   /**
+    * Returns a ordered list of interceptor classes which are applicable for the bean
+    * represented by this {@link InterceptorRegistry}. Returns an empty list if no such
+    * interceptors exist.
+    * <p>
+    *  Typically, this ordered list consists of:
+    *  <ul>
+    *    <li>Default interceptors for the bean</li>
+    *    <li>Class level interceptors for the bean</li>
+    *    <li>Method level interceptors for the bean</li>
+    *   </ul>
+    * </p>
+    * <p>
+    *  Typically, the interceptors for a bean are specified through the use of {@link Interceptors} annotation
+    *  on the bean or its xml equivalent. But it may *not* be limited to only such interceptors. Implementations
+    *  of {@link InterceptorRegistry} are free to return any other interceptor class(es) too.
+    * </p>
+    * @return
+    */
+   List<Class<?>> getInterceptorClasses();
+   
 }

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EJB3Deployment.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EJB3Deployment.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EJB3Deployment.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ejb3.container.spi.deployment;
+
+import java.util.Collection;
+
+import org.jboss.ejb3.container.spi.EJBContainer;
+
+/**
+ * An {@link EJB3Deployment} corresponds to a deployment unit with EJB3(.x)
+ * artifacts.
+ * 
+ * <p>
+ *  An {@link EJB3Deployment} typically consists of multiple {@link EJBContainer}s,
+ *  with each container representing a bean within the deployment.
+ * </p>
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EJB3Deployment
+{
+
+   /**
+    * Returns the name of the {@link EJB3Deployment}
+    * <p>
+    *   Typically this is the "module-name" of this deployment
+    * </p>
+    * @return 
+    */
+   String getName();
+   
+   /**
+    * @return Returns all the {@link EJBContainer}s within the scope of this {@link EJB3Deployment}.
+    * Returns an empty {@link Collection} if there are no {@link EJBContainer} in this
+    * deployment
+    */
+   Collection<EJBContainer> getEJBContainers();
+   
+   /**
+    * Returns the {@link EJBContainer} corresponding to the EJB name.
+    * <p>
+    *   Returns null if there's no {@link EJBContainer} for the passed <code>ejbName</code>.
+    * </p>
+    * <p>
+    *   A {@link EJB3Deployment} will not have more than one EJB with the same name, so this
+    *   method will not resolve the <code>ejbName</code> to more than one {@link EJBContainer} 
+    * </p>
+    * @param ejbName The unique EJB name within the deployment
+    * @return
+    */
+   EJBContainer getEJBContainer(String ejbName);
+   
+   /**
+    * Adds a {@link EJBContainer} to this {@link EJB3Deployment}.
+    * <p>
+    *  No more than one {@link EJBContainer} can exist within a {@link EJB3Deployment}
+    *  for the same EJB name. This method throws a {@link IllegalArgumentException} if
+    *  this {@link EJB3Deployment} already has a {@link EJBContainer} for the EJB name
+    *  returned by {@link EJBContainer#getEJBName()}  
+    * </p>
+    * @param ejbContainer A {@link EJBContainer} to be added to the {@link EJB3Deployment}
+    * @throws IllegalArgumentException If there's already a {@link EJBContainer} in this
+    *                   {@link EJB3Deployment} for the EJB name returned by {@link EJBContainer#getEJBName()}
+    */
+   void addContainer(EJBContainer ejbContainer) throws IllegalArgumentException;
+   
+   /**
+    * Removes an existing {@link EJBContainer} from this {@link EJB3Deployment}
+    * 
+    * @param ejbContainer The {@link EJBContainer} to be removed from the {@link EJB3Deployment}
+    * @throws IllegalArgumentException If the passed <code>ejbContainer</code> was not part of
+    *                           this {@link EJB3Deployment}
+    */
+   void removeEJBContainer(EJBContainer ejbContainer) throws IllegalArgumentException;
+}

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EnterpriseDeployment.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EnterpriseDeployment.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/deployment/EnterpriseDeployment.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ejb3.container.spi.deployment;
+
+import java.util.Collection;
+
+/**
+ * An {@link EnterpriseDeployment} contains one or more {@link EJB3Deployment}s.
+ * 
+ * <p>
+ *  As an example, a .ear deployment with multiple EJB .jar deployments can be represented
+ *  as a {@link EnterpriseDeployment} consisting of multiple {@link EJB3Deployment} 
+ * </p>
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EnterpriseDeployment
+{
+
+   /**
+    * Returns the name of the {@link EnterpriseDeployment} 
+    * @return
+    */
+   String getName();
+   
+   /**
+    * Returns all the {@link EJB3Deployment}s which are deployed as part of 
+    * this {@link EnterpriseDeployment}. Returns an empty collection if there
+    * are no such {@link EJB3Deployment}s
+    * @return
+    */
+   Collection<EJB3Deployment> getEJB3Deployments();
+   
+   /**
+    * Adds the passed <code>ejb3Deployment</code> to this {@link EnterpriseDeployment}
+    * 
+    * <p>
+    *   An {@link EnterpriseDeployment} cannot have more than one {@link EJB3Deployment} with
+    *   the same deployment name (which is returned by {@link EJB3Deployment#getName()}). If
+    *   an {@link EJB3Deployment} already exists with the same name, in this {@link EnterpriseDeployment},
+    *   then an {@link IllegalArgumentException} is thrown.
+    * </p>
+    * @param ejb3Deployment The {@link EJB3Deployment} to be added to this {@link EnterpriseDeployment}
+    * @throws IllegalArgumentException If an {@link EJB3Deployment} with the same name as the passed 
+    *                       {@link EJB3Deployment#getName()} already exists in this {@link EnterpriseDeployment}
+    */
+   void addEJB3Deployment(EJB3Deployment ejb3Deployment) throws IllegalArgumentException;
+   
+   /**
+    * Removes an already existing {@link EJB3Deployment} from this {@link EnterpriseDeployment}
+    * 
+    * @param ejb3Deployment The {@link EJB3Deployment} to be removed from this {@link EnterpriseDeployment}
+    * @throws IllegalArgumentException If the passed <code>ejb3Deployment</code> is not 
+    *                               part of this {@link EnterpriseDeployment}
+    */
+   void removeEJB3Deployment(EJB3Deployment ejb3Deployment) throws IllegalArgumentException;
+   
+}

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/EJBLifecycleHandler.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/EJBLifecycleHandler.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/EJBLifecycleHandler.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -25,7 +25,6 @@
 import org.jboss.ejb3.container.spi.EJBInstanceManager;
 
 /**
- * EJBLifecycleHandler
  *
  * <p>
  * An {@link EJBLifecycleHandler} is responsible for handling lifecycle events 

Modified: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/StatefulEJBLifecycleHandler.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/StatefulEJBLifecycleHandler.java	2010-03-01 13:47:36 UTC (rev 101654)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/StatefulEJBLifecycleHandler.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -24,7 +24,7 @@
 import org.jboss.ejb3.container.spi.BeanContext;
 
 /**
- * StatefulEJBLifecycleHandler
+ * 
  * <p>
  *  A {@link StatefulEJBLifecycleHandler} is responsible for handling lifecycle events
  *  of a stateful bean instance.

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/remote/RemotingContainer.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/remote/RemotingContainer.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/remote/RemotingContainer.java	2010-03-01 13:50:21 UTC (rev 101655)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ejb3.container.spi.remote;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+
+/**
+ * A EJB3 container which will be used outside of the JVM where the real
+ * container resides. This RemotingContainer is responsible for passing on the
+ * control to the remote real container
+ * <p>
+ *  Note that the {@link RemotingContainer} is expected to run on the client side
+ *  and hence should not expect any server side components to be available during
+ *  its execution
+ * </p>
+ *
+ * TODO: Should this interface extend from java.rmi.Remote or should the
+ * individual impls decide whether to extend from java.rmi.Remote?
+ * 
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface RemotingContainer extends java.rmi.Remote
+{
+
+   /**
+    * Invoke on a remote container. 
+    * <p>
+    * Before invoking on the real container, implementations of the RemotingContainer
+    * are free to pass the method invocation through a set of client side interceptors.
+    * </p>
+    * 
+    */
+   public Object invoke(Serializable sessionId, Method method, Object[] args, Class<?> businessIntf)
+         throws RemoteException;
+}




More information about the jboss-cvs-commits mailing list