[jboss-cvs] JBossAS SVN: r72294 - projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 16 12:04:10 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-04-16 12:04:10 -0400 (Wed, 16 Apr 2008)
New Revision: 72294

Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/DeploymentScope.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
Log:
EJBTHREE-1291, move the ejb resolver logic into DeploymentScope as a first test.

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/DeploymentScope.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/DeploymentScope.java	2008-04-16 16:00:27 UTC (rev 72293)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/DeploymentScope.java	2008-04-16 16:04:10 UTC (rev 72294)
@@ -23,6 +23,8 @@
 
 import java.util.Collection;
 
+import javax.naming.NameNotFoundException;
+
 import org.jboss.ejb3.javaee.JavaEEApplication;
 
 /**
@@ -44,6 +46,23 @@
     * @return
     */
    Ejb3Deployment findRelativeDeployment(String relativeName);
+   /**
+    * Obtain the EJBContainer best matching the business interface
+    * @param businessIntf - the business interface to match
+    * @param vfsContext - the vfs path to the deploment initiating the request
+    * @return the matching EJBContainer if found, null otherwise.
+    */
+   EJBContainer getEjbContainer(Class businessIntf, String vfsContext)
+      throws NameNotFoundException;
+   /**
+    * Obtain the EJBContainer best matching the business interface
+    * @param ejbLink - the referencing ejb-link
+    * @param businessIntf - the business interface to match
+    * @param vfsContext - the vfs path to the deploment initiating the request
+    * @return the matching EJBContainer if found, null otherwise.
+    */
+   EJBContainer getEjbContainer(String ejbLink, Class businessIntf, String vfsContext);
+
    String getShortName();
    String getBaseName();
 }

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2008-04-16 16:00:27 UTC (rev 72293)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2008-04-16 16:04:10 UTC (rev 72294)
@@ -122,8 +122,6 @@
 
    protected DeploymentScope deploymentScope;
 
-   protected EjbModuleEjbResolver ejbRefResolver;
-
    protected EjbModulePersistenceUnitResolver persistenceUnitResolver;
 
    protected MessageDestinationResolver messageDestinationResolver;
@@ -152,7 +150,6 @@
       {
          throw new RuntimeException(e);
       }
-      ejbRefResolver = new EjbModuleEjbResolver(deploymentScope, unit.getShortName(), ejbContainers, this);
       persistenceUnitResolver = new EjbModulePersistenceUnitResolver(persistenceUnitDeployments, deploymentScope,
             ejbContainers);
       MessageDestinationsMetaData destinations = null;
@@ -362,31 +359,34 @@
       return persistenceUnitDeployments;
    }
 
+
    public EJBContainer getEjbContainer(String ejbLink, Class businessIntf)
    {
-      return ejbRefResolver.getEjbContainer(ejbLink, businessIntf);
+      String relativePath = unit.getRelativePath();
+      EJBContainer container = deploymentScope.getEjbContainer(ejbLink, businessIntf, relativePath);
+      return container;
    }
 
    public String getEjbJndiName(String ejbLink, Class businessIntf)
    {
-      return ejbRefResolver.getEjbJndiName(ejbLink, businessIntf);
+      EJBContainer container = getEjbContainer(ejbLink, businessIntf);
+      String jndiName = ProxyFactoryHelper.getJndiName(container, businessIntf);
+      return jndiName;
    }
-
-   public EJBContainer getEjbContainer(Ejb3Deployment deployment, Class businessIntf) throws NameNotFoundException
+   public String getEjbJndiName(Class businessIntf)
+      throws NameNotFoundException
    {
-      return ejbRefResolver.getEjbContainer(deployment, businessIntf);
+      EJBContainer container = getEjbContainer(businessIntf);
+      String jndiName = ProxyFactoryHelper.getJndiName(container, businessIntf);
+      return jndiName;
    }
 
    public EJBContainer getEjbContainer(Class businessIntf) throws NameNotFoundException
    {
-      return ejbRefResolver.getEjbContainer(businessIntf);
+      String relativePath = unit.getRelativePath();
+      return deploymentScope.getEjbContainer(businessIntf, relativePath);
    }
 
-   public String getEjbJndiName(Class businessIntf) throws NameNotFoundException
-   {
-      return ejbRefResolver.getEjbJndiName(businessIntf);
-   }
-
    protected void processEJBContainerMetadata(Container container) throws Exception
    {
       log.trace("Process EJB container metadata " + container);




More information about the jboss-cvs-commits mailing list