[webbeans-commits] Webbeans SVN: r2926 - in ri/trunk/spi/src/main/java/org/jboss/webbeans: ejb/spi and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Jun 29 10:09:05 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-06-29 10:09:05 -0400 (Mon, 29 Jun 2009)
New Revision: 2926

Added:
   ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
Modified:
   ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/BusinessInterfaceDescriptor.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwadingBusinessInterfaceDescriptor.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java
Log:
Add BeanDeploymentArchive SPI

Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java	                        (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bootstrap.spi;
+
+import java.net.URL;
+import java.util.List;
+
+/**
+ * Represents a CDI bean deployment archive.
+ * 
+ * A bean deployment archive is any library jar, EJB jar or rar archive with a
+ * META-INF/beans.xml file, any WEB-INF/classes directory in war with a
+ * WEB-INF/beans.xml, or any directory in the classpath with a
+ * META-INF/beans.xml.
+ * 
+ * For an application deployed as an ear, all library jars, EJB jars, rars and
+ * war WEB-INF/classes directories should be searched.
+ * 
+ * For an application deployed as a war, all library jars and the
+ * WEB-INF/classes directory should be searched.
+ * 
+ * @see
+ * 
+ * @author Pete Muir
+ * 
+ */
+public interface BeanDeploymentArchive
+{
+
+   /**
+    * Get the ordered transitive closure of modules which are accessible to this
+    * module. The order will be used both in bean discovery and resolution.
+    * 
+    * Circular dependencies will be detected and ignored by the container
+    * 
+    * @return the ordered transitive closure
+    */
+   public List<BeanDeploymentArchive> getBeanDeploymentArchiveClosure();
+
+   /**
+    * Gets all classes in the bean deployment archive
+    * 
+    * @return an iteration over the classes
+    */
+   public Iterable<Class<?>> getBeanClasses();
+
+   /**
+    * Get the deployment descriptor
+    * 
+    * @return a URL pointing to the deployment descriptor
+    */
+   public URL getBeansXml();
+
+}


Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -26,8 +26,10 @@
  * discover the beans to deploy
  * 
  * @author Pete Muir
+ * @deprecated now encapsulated by {@link BeanDeploymentArchive}
  *
  */
+ at Deprecated
 public interface WebBeanDiscovery extends Service
 {
    

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/BusinessInterfaceDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/BusinessInterfaceDescriptor.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/BusinessInterfaceDescriptor.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -31,12 +31,5 @@
     * Gets the business interface class
     */
    public Class<T> getInterface();
-
-   /**
-    * Gets the JNDI name under which the EJB is registered
-    * 
-    * @return The JNDI name
-    */
-   public String getJndiName();
    
 }
\ No newline at end of file

Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java	                        (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.ejb.spi;
+
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * Represents an EJB bean deployment archive.
+ * 
+ * If a bean deployment archive is identified as an EJB bean deployment, an
+ * instance of {@link EJBModule} should be returned instead of
+ * {@link BeanDeploymentArchive}; the Java EE container is responsible for
+ * identifying EJB bean deployment archives.
+ * 
+ * @author Pete Muir
+ * 
+ */
+public interface EJBModule extends BeanDeploymentArchive
+{
+
+   /**
+    * Get all the EJBs in the deployment archive 
+    * 
+    * @return
+    */
+   public Iterable<EjbDescriptor<?>> getEjbs();
+
+}


Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -35,7 +35,7 @@
     * 
     * @return The EJB Bean class
     */
-   public Class<T> getType();
+   public Class<T> getBeanClass();
 
    /**
     * Gets the local business interfaces of the EJB
@@ -45,13 +45,6 @@
    public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();
    
    /**
-    * Gets the remote business interfaces of the EJB
-    * 
-    * @return An iterator over the remote business interfaces
-    */
-   public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();
-   
-   /**
     * Get the remove methods of the EJB
     * 
     * @return An iterator over the remove methods
@@ -59,38 +52,31 @@
    public Iterable<Method> getRemoveMethods();
 
    /**
-    * Indicates if the bean is stateless
+    * Indicates if the bean is a stateless session bean 
     * 
     * @return True if stateless, false otherwise
     */
    public boolean isStateless();
 
    /**
-    * Indicates if the bean is a EJB 3.1 Singleton
+    * Indicates if the bean is a EJB 3.1 Singleton session bean
     * 
     * @return True if the bean is a singleton, false otherwise
     */
    public boolean isSingleton();
 
    /**
-    * Indicates if the EJB is stateful
+    * Indicates if the EJB is a stateful session bean
     * 
     * @return True if the bean is stateful, false otherwise
     */
    public boolean isStateful();
 
    /**
-    * Indicates if the EJB is and MDB
+    * Indicates if the EJB is an MDB
     * 
     * @return True if the bean is an MDB, false otherwise
     */
    public boolean isMessageDriven();
-
-   /**
-    * Gets the EJB name
-    * 
-    * @return The name
-    */
-   public String getEjbName();
    
 }

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -74,8 +74,10 @@
    /**
     * Gets a descriptor for each EJB in the application
     * 
+    * @deprecated an {@link EJBModule} should be used to represent all EJBs
     * @return the EJB descriptors
     */
+   @Deprecated
    public Iterable<EjbDescriptor<?>> discoverEjbs();
    
 }

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwadingBusinessInterfaceDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwadingBusinessInterfaceDescriptor.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwadingBusinessInterfaceDescriptor.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -23,11 +23,6 @@
       return delegate().getInterface();
    }
    
-   public String getJndiName()
-   {
-      return delegate().getJndiName();
-   }
-   
    @Override
    public boolean equals(Object obj)
    {

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java	2009-06-29 11:35:57 UTC (rev 2925)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java	2009-06-29 14:09:05 UTC (rev 2926)
@@ -20,31 +20,20 @@
 {
    
    protected abstract EjbDescriptor<T> delegate();
-   
-   
-   public String getEjbName()
-   {
-      return delegate().getEjbName();
-   }
-   
+      
    public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
    {
       return delegate().getLocalBusinessInterfaces();
    }
    
-   public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces()
-   {
-      return delegate().getRemoteBusinessInterfaces();
-   }
-   
    public Iterable<Method> getRemoveMethods()
    {
       return delegate().getRemoveMethods();
    }
    
-   public Class<T> getType()
+   public Class<T> getBeanClass()
    {
-      return delegate().getType();
+      return delegate().getBeanClass();
    }
    
    public boolean isMessageDriven()




More information about the weld-commits mailing list