[jboss-cvs] JBossAS SVN: r73116 - in trunk/ejb3/src/main/org/jboss/ejb3: deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 7 12:34:31 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-05-07 12:34:30 -0400 (Wed, 07 May 2008)
New Revision: 73116

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/EJBRegistrationDeployer.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3Deployer.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentScope.java
Log:
Set the DeploymentScope base name to an empty string if the deployment is a standalone jar

Modified: trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-05-07 16:28:04 UTC (rev 73115)
+++ trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-05-07 16:34:30 UTC (rev 73116)
@@ -143,7 +143,8 @@
       //DeploymentScope scope = null;
       if (unit.getParent() != null)
       {
-         this.deploymentScope = new JBoss5DeploymentScope(unit.getParent());
+         boolean isEar = unit != unit.getTopLevel();
+         this.deploymentScope = new JBoss5DeploymentScope(unit.getParent(), isEar);
       }
 
       ejbResolver = new ClientEjbResolver(deploymentScope, unit.getSimpleName());

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/EJBRegistrationDeployer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/EJBRegistrationDeployer.java	2008-05-07 16:28:04 UTC (rev 73115)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/EJBRegistrationDeployer.java	2008-05-07 16:34:30 UTC (rev 73116)
@@ -235,12 +235,13 @@
             scope = (JBoss5DeploymentScope) parent.getAttachment(DeploymentScope.class);
             if (scope == null)
             {
+               boolean isEar = unit != unit.getTopLevel();
                if(parent.isAttachmentPresent(DeploymentEndpointResolver.class) == true)
-                  scope = new JBoss5DeploymentScope(parent);
+                  scope = new JBoss5DeploymentScope(parent, isEar);
                else
                {
                   // EJBTHREE-1291
-                  scope = new JBoss5DeploymentScope(parent, unit.getSimpleName());
+                  scope = new JBoss5DeploymentScope(parent, isEar, unit.getSimpleName());
                   initScopeDeployment = true;
                }
                parent.addAttachment(DeploymentScope.class, scope);

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3Deployer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3Deployer.java	2008-05-07 16:28:04 UTC (rev 73115)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3Deployer.java	2008-05-07 16:34:30 UTC (rev 73116)
@@ -147,12 +147,13 @@
             scope = (JBoss5DeploymentScope) parent.getAttachment(DeploymentScope.class);
             if (scope == null)
             {
+               boolean isEar = unit != unit.getTopLevel();
                if(parent.isAttachmentPresent(DeploymentEndpointResolver.class) == true)
-                  scope = new JBoss5DeploymentScope(parent);
+                  scope = new JBoss5DeploymentScope(parent, isEar);
                else
                {
                   // EJBTHREE-1291
-                  scope = new JBoss5DeploymentScope(parent, unit.getSimpleName());
+                  scope = new JBoss5DeploymentScope(parent, isEar, unit.getSimpleName());
                   initScopeDeployment = true;
                }
                parent.addAttachment(DeploymentScope.class, scope);

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentScope.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentScope.java	2008-05-07 16:28:04 UTC (rev 73115)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentScope.java	2008-05-07 16:34:30 UTC (rev 73116)
@@ -61,15 +61,18 @@
    private String baseName;
 
    @SuppressWarnings("unchecked")
-   public JBoss5DeploymentScope(VFSDeploymentUnit parent)
+   public JBoss5DeploymentScope(VFSDeploymentUnit parent, boolean isEar)
    {
       this.shortName = parent.getSimpleName();
-      this.baseName = shortName;
+      baseName = "";
+      if(isEar)
+      {
+         this.baseName = shortName;
+         int idx = shortName.lastIndexOf('.');
+         if( idx > 0 )
+            baseName = shortName.substring(0, idx);
+      }
 
-      int idx = shortName.lastIndexOf('.');
-      if( idx > 0 )
-         baseName = shortName.substring(0, idx);
-
       // Create the deployment map attachment if it does not exist
       deployments = (ConcurrentHashMap<String, Ejb3Deployment>)parent.getAttachment(ATTACHMENT_KEY);
       if (deployments == null)
@@ -87,13 +90,11 @@
    /**
     * Temp ctor until EJBTHREE-1291 is resolved
     * @param parent
-    * @param errorName
-    * @param ejbContainers
-    * @param deployment
+    * @param shortName
     */
-   public JBoss5DeploymentScope(VFSDeploymentUnit parent, String errorName)
+   public JBoss5DeploymentScope(VFSDeploymentUnit parent, boolean isEar, String shortName)
    {
-      this(parent);
+      this(parent, isEar);
       ejbRefResolver = new EjbModuleEjbResolver(this, shortName);
    }
    public void setDeployment(Ejb3Deployment deployment)




More information about the jboss-cvs-commits mailing list