[jboss-cvs] JBossAS SVN: r61632 - in trunk/tomcat/src/main/org/jboss/web/tomcat/service: deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 23 02:52:36 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-03-23 02:52:35 -0400 (Fri, 23 Mar 2007)
New Revision: 61632

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/TomcatInjectionContainer.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/WarEjbResolver.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment2.java
Log:
Add resolution of ejb2 ejb refs.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/TomcatInjectionContainer.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/TomcatInjectionContainer.java	2007-03-23 05:37:51 UTC (rev 61631)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/TomcatInjectionContainer.java	2007-03-23 06:52:35 UTC (rev 61632)
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.management.MBeanServer;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NameNotFoundException;
@@ -133,14 +134,14 @@
    protected WebApplication appInfo;
    protected WebDD webDD;
 
-   public TomcatInjectionContainer(WebApplication appInfo, DeploymentUnit unit)
+   public TomcatInjectionContainer(WebApplication appInfo, DeploymentUnit unit, MBeanServer server)
    {
       this.unit = unit;
       DeploymentScope deploymentScope = null;
       this.appInfo = appInfo;
 
       persistenceUnitResolver = new DeploymentPersistenceUnitResolver(persistenceUnitDeployments, deploymentScope, ejbContainers);
-      ejbResolver = new WarEjbResolver(deploymentScope, unit.getSimpleName());
+      ejbResolver = new WarEjbResolver(deploymentScope, unit, server);
    }
 
    public EnvironmentRefGroup getEnvironmentRefGroup()

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/WarEjbResolver.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/WarEjbResolver.java	2007-03-23 05:37:51 UTC (rev 61631)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/WarEjbResolver.java	2007-03-23 06:52:35 UTC (rev 61632)
@@ -21,10 +21,13 @@
 */
 package org.jboss.web.tomcat.service;
 
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ejb.EjbUtil50;
 import org.jboss.ejb3.enc.DeploymentEjbResolver;
 import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.DeploymentScope;
 
+import javax.management.MBeanServer;
 import javax.naming.NameNotFoundException;
 
 /**
@@ -35,17 +38,33 @@
  */
 public class WarEjbResolver extends DeploymentEjbResolver
 {
-   public WarEjbResolver(DeploymentScope deploymentScope, String errorName)
+   private DeploymentUnit unit;
+   private MBeanServer server;
+
+   public WarEjbResolver(DeploymentScope deploymentScope, DeploymentUnit unit,
+         MBeanServer server)
    {
-      super(deploymentScope, errorName);
+      super(deploymentScope, unit.getSimpleName());
+      this.unit = unit;
    }
 
+   
+   @Override
+   public String getEjbJndiName(String ejbLink, Class businessIntf)
+   {
+      String name = super.getEjbJndiName(ejbLink, businessIntf);
+      if( name == null )
+         name = EjbUtil50.findEjbLink(server, unit, ejbLink);
+      return name;
+   }
+
    protected EJBContainer searchDeploymentInternally(String ejbLink, Class businessIntf)
    {
       return null;
    }
 
-   protected EJBContainer searchForEjbContainerInternally(Class businessIntf) throws NameNotFoundException
+   protected EJBContainer searchForEjbContainerInternally(Class businessIntf)
+      throws NameNotFoundException
    {
       return null;
    }

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2007-03-23 05:37:51 UTC (rev 61631)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2007-03-23 06:52:35 UTC (rev 61632)
@@ -162,7 +162,7 @@
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
       metaData.setContextLoader(loader);
 
-      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit());
+      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit(), server);
 
       Loader webLoader = webApp.getDeploymentUnit().getAttachment(Loader.class);
       if (webLoader == null)

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment2.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment2.java	2007-03-23 05:37:51 UTC (rev 61631)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment2.java	2007-03-23 06:52:35 UTC (rev 61632)
@@ -159,7 +159,7 @@
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
       metaData.setContextLoader(loader);
 
-      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit());
+      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit(), server);
 
       Loader webLoader = webApp.getDeploymentUnit().getAttachment(Loader.class);
       if (webLoader == null)




More information about the jboss-cvs-commits mailing list