[jboss-cvs] JBossAS SVN: r109466 - trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 25 05:14:43 EST 2010


Author: jaikiran
Date: 2010-11-25 05:14:42 -0500 (Thu, 25 Nov 2010)
New Revision: 109466

Modified:
   trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java
Log:
JBAS-8548 MessageDestinationResourceProvider should pass a non-component DU to message destination resolver

Modified: trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java
===================================================================
--- trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java	2010-11-25 09:09:26 UTC (rev 109465)
+++ trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java	2010-11-25 10:14:42 UTC (rev 109466)
@@ -72,9 +72,6 @@
       // Now check if a message-destination link is specified.
       // The "link" itself is a logical name to the destination, so we'll
       // use a resolver to resolve a jndi name out of it.
-      // Note that a message-destination can *only* be specified in a ejb-jar deployment
-      // (see Java EE6 spec, EE.5.9.2), so the message-destination link resolver 
-      // needs to be provided by some JBoss EJB3 container component
       String messageDestLink = messageDestRef.getMessageDestinationLink();
       if (messageDestLink != null && !messageDestLink.trim().isEmpty())
       {
@@ -86,7 +83,16 @@
          }
          else
          {
-            String resolvedJNDIName = this.messageDestinationResolver.resolveMessageDestinationJndiName(unit, messageDestLink);
+            // the DU which depends on this message-destination-ref 
+            DeploymentUnit dependentDU = unit;
+            // the MessageDestinationReferenceResolver works on non-component deployment units.
+            // So if we are currently processing component DUs (like we do for EJBs), then pass the
+            // component DUs parent during resolution.
+            if (unit.isComponent())
+            {
+               dependentDU = unit.getParent();
+            }
+            String resolvedJNDIName = this.messageDestinationResolver.resolveMessageDestinationJndiName(dependentDU, messageDestLink);
             logger.debug("Resolved jndi-name: " + resolvedJNDIName + " for message-destination link: "
                   + messageDestLink + " in message-destination-ref: " + messageDestRef.getName());
             if (resolvedJNDIName != null && !resolvedJNDIName.trim().isEmpty())



More information about the jboss-cvs-commits mailing list