[jboss-cvs] JBossAS SVN: r88652 - projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 11 13:13:25 EDT 2009


Author: wolfc
Date: 2009-05-11 13:13:25 -0400 (Mon, 11 May 2009)
New Revision: 88652

Modified:
   projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEJBIdentifier.java
Log:
EJBTHREE-1830: fixed EAR detection

Modified: projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEJBIdentifier.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEJBIdentifier.java	2009-05-11 16:41:53 UTC (rev 88651)
+++ projects/ejb3/trunk/endpoint-deployer/src/main/java/org/jboss/ejb3/endpoint/deployers/DefaultEJBIdentifier.java	2009-05-11 17:13:25 UTC (rev 88652)
@@ -26,7 +26,7 @@
 
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.logging.Logger;
-import org.jboss.metadata.ear.spec.EarMetaData;
+import org.jboss.metadata.ear.jboss.JBossAppMetaData;
 
 /**
  * DefaultEJBIdentifier
@@ -34,6 +34,8 @@
  * Default implementation of an EJB Identifier; returns the name under
  * which a specified EJB (within some scoped DeploymentUnit) is bound into
  * MC 
+ * 
+ * TODO: move this to the component defining the EJB container name
  *
  * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
  * @version $Revision: $
@@ -48,6 +50,8 @@
     */
    public String identifyEJB(DeploymentUnit unit, String ejbName)
    {
+      // See JavaEEComponentHelper.createObjectName
+      
       // TODO the base ejb3 jmx object name comes from Ejb3Module.BASE_EJB3_JMX_NAME, but
       // we don't need any reference to ejb3-core. Right now just hard code here, we need
       // a better way/place for this later
@@ -55,17 +59,14 @@
 
       // Get the top level unit for this unit (ex: the top level might be an ear and this unit might be the jar
       // in that ear
+      // See AS Ejb3Deployer.deploy
       DeploymentUnit toplevelUnit = unit.getTopLevel();
-      if (toplevelUnit != null)
+      boolean isEar = unit != unit.getTopLevel() || toplevelUnit.isAttachmentPresent(JBossAppMetaData.class);
+      if (isEar)
       {
-         // if top level is an ear, then create the name with the ear reference
-         if (toplevelUnit.getAttachment(EarMetaData.class) != null)
-         {
-            containerName.append("ear=");
-            containerName.append(toplevelUnit.getSimpleName());
-            containerName.append(",");
-
-         }
+         containerName.append("ear=");
+         containerName.append(toplevelUnit.getSimpleName());
+         containerName.append(",");
       }
       // now work on the passed unit, to get the jar name
       if (unit.getSimpleName() == null)




More information about the jboss-cvs-commits mailing list