[jboss-cvs] JBossAS SVN: r100210 - in projects/ejb3/components: container and 13 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 1 09:10:04 EST 2010


Author: jaikiran
Date: 2010-02-01 09:10:02 -0500 (Mon, 01 Feb 2010)
New Revision: 100210

Added:
   projects/ejb3/components/container/
   projects/ejb3/components/container/trunk/
   projects/ejb3/components/container/trunk/build/
   projects/ejb3/components/container/trunk/build/pom.xml
   projects/ejb3/components/container/trunk/pom.xml
   projects/ejb3/components/container/trunk/spi/
   projects/ejb3/components/container/trunk/spi/pom.xml
   projects/ejb3/components/container/trunk/spi/src/
   projects/ejb3/components/container/trunk/spi/src/main/
   projects/ejb3/components/container/trunk/spi/src/main/java/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/
   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/ContainerInvocationContext.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/StatefulContainerInvocation.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulEJBInstanceManager.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatelessEJBInstanceManager.java
   projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/
   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
   projects/ejb3/components/container/trunk/spi/src/main/resources/
   projects/ejb3/components/container/trunk/spi/src/test/
   projects/ejb3/components/container/trunk/spi/src/test/java/
   projects/ejb3/components/container/trunk/spi/src/test/resources/
Log:
Initial commit for a JBoss EJB3 container spi

Added: projects/ejb3/components/container/trunk/build/pom.xml
===================================================================
--- projects/ejb3/components/container/trunk/build/pom.xml	                        (rev 0)
+++ projects/ejb3/components/container/trunk/build/pom.xml	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+    <!--
+  vi:ts=2:sw=2:expandtab:
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!-- Parent -->
+    <parent>
+        <groupId>org.jboss</groupId>
+        <artifactId>jboss-parent</artifactId>
+        <version>4</version>
+    </parent>
+
+    <!-- Model Version -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- Artifact Configuration -->
+    <groupId>org.jboss.ejb3.container</groupId>
+    <artifactId>jboss-ejb3-container-build</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>JBoss EJB3 container build module</name>
+    <description>Centralized Build Configuration for JBoss EJB3 container</description>
+    <packaging>pom</packaging>
+
+    <!-- Properties -->
+    <properties>
+
+        <!-- Versioning -->
+        <version.junit_junit>4.6</version.junit_junit>
+        <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
+        <version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
+    </properties>
+
+    <!-- SCM -->
+    <scm>
+        <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/container</connection>
+        <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/ejb3/components/container</developerConnection>
+        <url>http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/container</url>
+    </scm>
+
+    <!-- Issues -->
+    <issueManagement>
+        <system>jira</system>
+        <url>http://jira.jboss.com/jira/browse/EJBTHREE</url>
+    </issueManagement>
+
+    <!-- Build -->
+    <build>
+
+        <plugins>
+
+            <!-- Compiler / JDK6 required for EJB 3.1 -->
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <inherited>true</inherited>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <showDeprecation>false</showDeprecation>
+                    <showWarnings>true</showWarnings>
+                    <optimize>true</optimize>
+                    <compilerVersion>1.6</compilerVersion>
+                    <fork>true</fork>
+                    <argLine>-Xmx512M</argLine>
+                    <executable>${JAVA_HOME}/bin/javac</executable>
+                </configuration>
+            </plugin>
+
+            <!-- Surefire -->
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <trimStackTrace>false</trimStackTrace>
+                    <printSummary>true</printSummary>
+                    <includes>
+                        <include>**/*TestCase.java</include>
+                        <include>**/*TestSuite.java</include>
+                    </includes>
+                    <forkMode>always</forkMode>
+                    <reportFormat>xml</reportFormat>
+                </configuration>
+            </plugin>
+
+            <!-- Maven Release Plugin Configuration -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <configuration>
+                    <tagBase>https://svn.jboss.org/repos/jbossas/projects/ejb3/tags</tagBase>
+                </configuration>
+            </plugin>
+
+            <!-- Enforce Maven Environment -->
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>enforce-maven-environment</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <rules>
+                        <requireJavaVersion>
+                            <version>1.6</version> <!-- Must be JDK6 -->
+                        </requireJavaVersion>
+                        <requireProperty>
+                            <property>env.JAVA_HOME</property>
+                            <message>"JAVA_HOME needs to be
+                                set to compile"</message>
+                        </requireProperty>
+                    </rules>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
+
+    <!-- Dependency Management -->
+    <dependencyManagement>
+        <dependencies>
+
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>${version.junit_junit}</version>
+                <scope>test</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.jboss.logging</groupId>
+                <artifactId>jboss-logging-log4j</artifactId>
+                <version>${version.jboss.logging.log4j}</version>
+                <scope>runtime</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.jboss.logging</groupId>
+                <artifactId>jboss-logging-spi</artifactId>
+                <version>${version.jboss.logging.spi}</version>
+            </dependency>
+
+
+        </dependencies>
+    </dependencyManagement>
+
+    <!-- Reporting -->
+    <reporting>
+        <plugins>
+
+            <!-- Cobertura (Code Coverage) -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>cobertura-maven-plugin</artifactId>
+                <configuration>
+                    <formats>
+                        <format>html</format>
+                        <format>xml</format>
+                    </formats>
+                </configuration>
+            </plugin>
+
+            <!-- FindBugs -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>findbugs-maven-plugin</artifactId>
+                <configuration>
+                    <xmlOutput>true</xmlOutput>
+                    <findbugsXmlOutputDirectory>target/site</findbugsXmlOutputDirectory>
+                </configuration>
+            </plugin>
+
+            <!-- JavaDoc / APIViz -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <doclet>org.jboss.apiviz.APIviz</doclet>
+                    <docletArtifact>
+                        <groupId>org.jboss.apiviz</groupId>
+                        <artifactId>apiviz</artifactId>
+                        <version>1.3.0.GA</version>
+                    </docletArtifact>
+                    <useStandardDocletOptions>true</useStandardDocletOptions>
+                    <charset>UTF-8</charset>
+                    <encoding>UTF-8</encoding>
+                    <docencoding>UTF-8</docencoding>
+                    <breakiterator>true</breakiterator>
+                    <version>true</version>
+                    <author>true</author>
+                    <keywords>true</keywords>
+                    <additionalparam>
+                        -sourceclasspath ${project.build.outputDirectory}
+          </additionalparam>
+                </configuration>
+            </plugin>
+
+
+        </plugins>
+    </reporting>
+
+</project>
+

Added: projects/ejb3/components/container/trunk/pom.xml
===================================================================
--- projects/ejb3/components/container/trunk/pom.xml	                        (rev 0)
+++ projects/ejb3/components/container/trunk/pom.xml	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!-- Parent -->
+    <parent>
+        <groupId>org.jboss</groupId>
+        <artifactId>jboss-parent</artifactId>
+        <version>4</version>
+    </parent>
+
+    <!-- Model Information -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- Artifact Information  -->
+    <groupId>org.jboss.ejb3.container</groupId>
+    <artifactId>jboss-ejb3-container-aggregator</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <name>Aggregator for JBoss EJB3 container SPI</name>
+    <url>http://www.jboss.org</url>
+    <description>Aggregator for JBoss EJB3 container SPI</description>
+
+    <!-- Plugin Configuration -->
+    <build>
+        <plugins>
+
+            <!-- Deploy -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <!-- Don't include this aggregator in the deployment -->
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <!-- Aggregate Modules -->
+    <modules>
+        <!--  Order matters -->
+        <module>build</module>
+        <module>spi</module>
+    </modules>
+
+</project>

Added: projects/ejb3/components/container/trunk/spi/pom.xml
===================================================================
--- projects/ejb3/components/container/trunk/spi/pom.xml	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/pom.xml	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+
+    <parent>
+        <groupId>org.jboss.ejb3.container</groupId>
+        <artifactId>jboss-ejb3-container-build</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+        <relativePath>../build/pom.xml</relativePath>
+    </parent>
+    
+    <!-- Maven POM Model Version -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- Artifact Information -->
+    <groupId>org.jboss.ejb3.container</groupId>
+    <artifactId>jboss-ejb3-container-spi</artifactId>
+    <name>JBoss EJB3 Container SPI</name>
+    <description>
+		JBoss EJB3 Container SPI
+	</description>
+    <url>http://www.jboss.org/jbossejb3/</url>
+
+    <!-- Properties -->
+    <properties>
+
+        <!-- Versioning -->
+        <version.org.jboss.metadata.ejb>2.0.0-alpha-5</version.org.jboss.metadata.ejb>
+    </properties>
+    
+    <!-- Dependencies -->
+
+    
+
+    <dependencies>
+
+        <!-- JUnit -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.6</version>
+        </dependency>
+
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.jboss.logging</groupId>
+            <artifactId>jboss-logging-spi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jboss.metadata</groupId>
+            <artifactId>jboss-metadata-ejb</artifactId>
+            <version>${version.org.jboss.metadata.ejb}</version>
+        </dependency>
+
+
+    </dependencies>
+</project>

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/BeanContext.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,48 @@
+/*
+* 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;
+
+/**
+ * BeanContext
+ * <p>
+ *  A {@link BeanContext} holds the contextual information of a EJB instance
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface BeanContext
+{
+
+   /**
+    * Returns the bean instance
+    * @return
+    */
+   Object getBeanInstance();
+   
+   /**
+    * Returns the {@link EJBContainer} to which this {@link BeanContext} belongs
+    * @return
+    */
+   EJBContainer getEJBContainer();
+   
+   
+}

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocationContext.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocationContext.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/ContainerInvocationContext.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,51 @@
+/*
+* 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;
+
+import java.lang.reflect.Method;
+
+/**
+ * ContainerInvocationContext
+ * <p>
+ * A {@link ContainerInvocationContext} represents an invocation to be processed by the {@link EJBContainer#invoke(ContainerInvocationContext)}
+ * method. The {@link ContainerInvocationContext} holds the information about the method being invoked (on the bean proxy) and the
+ * arguments being passed to the method. It also has other contextual information about the invocation.
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface ContainerInvocationContext
+{
+
+   /**
+    * @return Returns the method being invoked
+    * 
+    */
+   Method getMethod();
+   
+   /**
+    * 
+    * @return Returns the arguments to be passed to the method being invoked
+    */
+   Object[] getArgs();
+   
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBContainer.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,91 @@
+/*
+* 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;
+
+import org.jboss.ejb3.container.spi.lifecycle.EJBLifecycleHandler;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+
+/**
+ * EJBContainer
+ * 
+ * Responsible for providing the necessary runtime infrastructure
+ * for EJB3 enterprise beans. TODO: Needs more javadoc 
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EJBContainer
+{
+   /**
+    * @return Name of the EJB to which this container corresponds to
+    */
+   String getEJBName();
+   
+   /**
+    * @return Fully qualified name of the bean implementation class
+    */
+   String getEJBClass();
+   
+   /**
+    * @return Returns the metadata associated with the EJB container
+    */
+   // TODO: Probably in later alpha versions of container-spi, we should move
+   // to a metadata-spi. Or else, its going to be difficult to support
+   // jboss-metadata-ejb which is already a bit of a mess
+   JBossEnterpriseBeanMetaData getMetaData();
+   
+   /**
+    * @return Returns the {@link EJBInstanceManager} responsible for creating/destroying
+    * bean instances
+    */
+   EJBInstanceManager getBeanInstanceManager();
+   
+   /**
+    * @return Returns the information related to the EJB deployment from which 
+    *       this container was formed. Individual implementation of {@link EJBContainer} may decide 
+    *       to return null if they do not have this information  
+    */
+   // TODO: Needs more thinking on this one
+   EJBDeploymentInfo getDeploymentInfo();
+   
+   /**
+    * Uses the information in the passed {@link ContainerInvocationContext} to 
+    * invoke on the target object.
+    * 
+    * @param containerInvocation The container invocation
+    * @return Returns the result of the invocation
+    * @throws Exception If something fails during the invocation 
+    */
+   Object invoke(ContainerInvocationContext containerInvocation) throws Exception;
+   
+   /**
+    * @return Returns the {@link InterceptorRegistry} corresponding to this container.
+    */
+   InterceptorRegistry getInterceptorRegistry();
+   
+   /**
+    * @return Returns the {@link EJBLifecycleHandler} which is responsible for handling the 
+    * lifecycle events (like PostConstruct, PreDestroy etc...) of a bean instance
+    * 
+    */
+   EJBLifecycleHandler getEJBLifecycleHandler();
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBDeploymentInfo.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,55 @@
+/*
+* 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;
+
+import java.net.URL;
+
+/**
+ * EJBDeploymentInfo
+ * 
+ * Provides various deployment related information of a EJB deployment  
+ *
+ * TODO: This one needs more thinking
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EJBDeploymentInfo
+{
+
+   /**
+    * @return Returns the classloader associated with this EJB deployment
+    */
+   ClassLoader getClassLoader();
+   
+   /**
+    * @return Returns the name of the EJB deployment
+    */
+   String getDeploymentName();
+   
+   // TODO: Is this enough/do we need this?
+   /**
+    * @return Returns the {@link URL} corresponding to this EJB deployment.
+    *       This method may return null, if for example, the EJB deployment
+    *       was constructed purely out of metadata and not a physical deployment. 
+    */
+   URL getDeployment();
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/EJBInstanceManager.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,55 @@
+/*
+* 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;
+
+/**
+ * EJBInstanceManager
+ * <p>
+ *  An {@link EJBInstanceManager} is responsible for creating/destroying bean
+ *  instances.
+ * </p>
+ * 
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EJBInstanceManager
+{
+
+   /**
+    * @return Creates and returns new {@link BeanContext}
+    * 
+    */
+   BeanContext create();
+
+   /**
+    * Destroys an already created {@link BeanContext}
+    * @param beanContext The {@link BeanContext} to be destroyed
+    * @throws IllegalArgumentException If the <code>beanContext</code> doesn't exist
+    */
+   void destroy(BeanContext beanContext) throws IllegalArgumentException;
+
+   /**
+    * @return Returns the {@link EJBContainer} to which this
+    * instance manager belongs
+    */
+   EJBContainer getEJBContainer();
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/InterceptorRegistry.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,67 @@
+/*
+* 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;
+
+/**
+ * InterceptorRegistry
+ *
+ * <p>
+ * An {@link InterceptorRegistry} for a {@link EJBContainer} is responsible 
+ * for applying any applicable interceptors to a target EJB instance during a 
+ * {@link ContainerInvocationContext}. It's upto the implementations of the {@link InterceptorRegistry}
+ * to get hold of the correct set of interceptors that need to be applied during the
+ * invocation. 
+ * </p>
+ * <p>
+ * The {@link InterceptorRegistry} does *not* enforce usage of any particular interceptor framework.
+ * It upto the underlying implementation of this interface to use any suitable interceptor framework.
+ * </p>
+ * TODO: Better name for this class?
+ * 
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface InterceptorRegistry
+{
+
+   /**
+    * Returns the {@link EJBContainer} to which this interceptor registry belongs
+    * @return
+    */
+   EJBContainer getEJBContainer();
+   
+   /**
+    * Intercepts a {@link ContainerInvocationContext}.
+    * <p>
+    *   This method is responsible to applying any interceptors applicable for the 
+    *   <code>targetBeanContext</code> object. The <code>targetBeanContext</code> holds the EJB instance
+    *   on which the {@link ContainerInvocationContext} is being done.    
+    * </p>
+    * @param containerInvocation The container invocation
+    * @param targetBeanContext The target bean context
+    * @return Returns the result of the invocation on the <code>target</code> object
+    * @throws Exception If any exception occurs during intercepting of the invocation on the 
+    *               <code>target</code> object
+    */
+   Object intercept(ContainerInvocationContext containerInvocation, BeanContext targetBeanContext) throws Exception;
+   
+}

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulContainerInvocation.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulContainerInvocation.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulContainerInvocation.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,43 @@
+/*
+* 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;
+
+import java.io.Serializable;
+
+/**
+ * StatefulContainerInvocation
+ * <p>
+ *  A {@link StatefulContainerInvocation} represents a {@link ContainerInvocationContext} on
+ *  a stateful bean 
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface StatefulContainerInvocation extends ContainerInvocationContext
+{
+
+   /**
+    * Returns the session id corresponding to the stateful bean instance.
+    * @return
+    */
+   Serializable getSessionId();
+}

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulEJBInstanceManager.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulEJBInstanceManager.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatefulEJBInstanceManager.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,60 @@
+/*
+* 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;
+
+import java.io.Serializable;
+
+/**
+ * StatefulEJBInstanceManager
+ *
+ * <p>
+ * A {@link StatefulEJBInstanceManager} is responsible for creating/destroying 
+ * stateful bean instances
+ * </p>
+ * @see EJBInstanceManager
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface StatefulEJBInstanceManager extends EJBInstanceManager
+{
+   /**
+    * Creates and returns a {@link BeanContext} corresponding to a 
+    * stateful session bean
+    * 
+    * @param initTypes The Class types of any init method corresponding to the stateful bean 
+    * @param initValues The params values to be passed to the init method corresponding to the
+    *                   stateful bean
+    * @return
+    */
+   BeanContext create(Class<?>[] initTypes, Object initValues[]);
+
+   /**
+    * Returns the {@link BeanContext} corresponding to the passed <code>sessionId</code>
+    * @param sessionId The session id of the bean context being requested for
+    * @return
+    * @throws IllegalArgumentException If no bean context corresponding to the passed <code>sessionId</code>
+    *                               was found
+    */
+   // TODO: Better (custom) exception to throw instead of IllegalArgumentException?
+   BeanContext get(Serializable sessionId) throws IllegalArgumentException;
+   
+}

Added: projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatelessEJBInstanceManager.java
===================================================================
--- projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatelessEJBInstanceManager.java	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/StatelessEJBInstanceManager.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,44 @@
+/*
+* 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;
+
+/**
+ * StatelessEJBInstanceManager
+ * <p>
+ *  A {@link StatelessEJBInstanceManager} is responsible for creating/destroying 
+ *  stateless bean instances.
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface StatelessEJBInstanceManager extends EJBInstanceManager
+{
+   /**
+    * @return Returns a {@link BeanContext} for a stateless session bean.
+    * It's upto the underlying implementation to either create a new bean
+    * instance and return the {@link BeanContext} or return an existing
+    * bean instance from a pool 
+    * 
+    */
+   BeanContext get();
+
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/EJBLifecycleHandler.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,80 @@
+/*
+* 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.lifecycle;
+
+import org.jboss.ejb3.container.spi.BeanContext;
+import org.jboss.ejb3.container.spi.EJBInstanceManager;
+
+/**
+ * EJBLifecycleHandler
+ *
+ * <p>
+ * An {@link EJBLifecycleHandler} is responsible for handling lifecycle events 
+ * of the bean instance. 
+ * </p>
+ * <p>
+ *  Typically, a {@link EJBInstanceManager} will invoke the lifecycle event callbacks
+ *  on this interface (like the {@link #postConstruct(BeanContext)}). The implementations 
+ *  of this interface are responsible for carrying out any appropriate actions (like invoking
+ *  the @PostConstruct method on the bean instance).
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface EJBLifecycleHandler
+{
+
+   /**
+    * Will be called upon construction of a bean context.
+    * <p>
+    *  Typically, this lifecycle callback method is responsible for carrying out 
+    *  any appropriate action on creation of the <code>beanContext</code>, like:
+    *  <ul>
+    *   <li>Dependency injection (if any) in the bean instance</li>
+    *   <li> Invoking any @PostConstruct methods on the bean instance
+    *   and any of the bean's interceptors.
+    *   </li>
+    *  </ul>
+    * </p>
+    * @param beanContext The {@link BeanContext}, upon whose construction, this
+    *       lifecycle method was invoked 
+    */
+   void postConstruct(BeanContext beanContext);
+
+   /**
+    * Will be called before destroying a bean context.
+    * <p>
+    *  This lifecycle callback method is responsible for carrying out 
+    *  any appropriate action before the <code>beanContext</code> is destroyed, like:
+    *  <ul>
+    *   <li> Invoking any @PreDestroy methods on the bean instance
+    *   and any of  it's interceptors</li>
+    *   <li>
+    *  </ul>
+    * </p>
+    * @param beanContext The {@link BeanContext}, before whose destruction, this
+    *       lifecycle method was invoked 
+    */
+   void preDestroy(BeanContext beanContext);
+   
+   
+}

Added: 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	                        (rev 0)
+++ projects/ejb3/components/container/trunk/spi/src/main/java/org/jboss/ejb3/container/spi/lifecycle/StatefulEJBLifecycleHandler.java	2010-02-01 14:10:02 UTC (rev 100210)
@@ -0,0 +1,84 @@
+/*
+* 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.lifecycle;
+
+import org.jboss.ejb3.container.spi.BeanContext;
+
+/**
+ * StatefulEJBLifecycleHandler
+ * <p>
+ *  A {@link StatefulEJBLifecycleHandler} is responsible for handling lifecycle events
+ *  of a stateful bean instance.
+ * </p>
+ * 
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface StatefulEJBLifecycleHandler extends EJBLifecycleHandler
+{
+
+   /**
+    *  Will be called upon construction of a bean context.
+    *  <p>
+    * Like the {@link EJBLifecycleHandler#postConstruct(BeanContext)} method, this 
+    * method is responsible for carrying out any appropriate actions on  
+    * creation of a stateful bean instance.
+    * </p> 
+    * <p>
+    * In addition to what the {@link EJBLifecycleHandler#postConstruct(BeanContext)} method
+    * is typically responsible for, this method invokes any init method on the stateful bean
+    * instance
+    * </p>
+    * @param beanContext The {@link BeanContext} on whose construction, this lifecycle callback
+    *                   method was invoked
+    * @param initTypes The Class types of any init method corresponding to the stateful bean 
+    * @param initValues The params values to be passed to the init method corresponding to the
+    *                   stateful bean
+    */
+   void postConstruct(BeanContext beanContext, Class<?>[] initTypes, Object initValues[]);
+   
+   /**
+    * Will be called before a stateful {@link BeanContext} is passivated
+    * <p>
+    *  Typically, this lifecycle callback method is responsible for carrying out
+    *  any appropriate actions, like:
+    *  <ul>
+    *   <li>Invoking any @PrePassivate method on the bean instance</li>
+    *  </ul>
+    * </p>
+    * @param beanContext The {@link BeanContext} which is being passivated
+    */
+   void prePassivate(BeanContext beanContext);
+   
+   /**
+    * Will be called after a stateful {@link BeanContext} is activated.
+    * <p>
+    * Typically, this lifecycle callback method is responsible for carrying out
+    *  any appropriate actions, like:
+    *  <ul>
+    *   <li>Invoking any @PostActivate method on the bean instance</li>
+    *  </ul>
+    * </p>
+    * @param beanContext The {@link BeanContext} which was activated
+    */
+   void postActivate(BeanContext beanContext);
+}




More information about the jboss-cvs-commits mailing list