[Jboss-cvs] JBossAS SVN: r56237 - trunk/server/src/main/org/jboss/metamodel/descriptor

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 25 00:16:34 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-25 00:16:31 -0400 (Fri, 25 Aug 2006)
New Revision: 56237

Modified:
   trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java
   trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java
   trunk/server/src/main/org/jboss/metamodel/descriptor/MessageDestinationRef.java
Log:
EJBTHREE-693, initial fixes for handling valid jboss-web.xml constructs. This adds support for message-destination-links.

Modified: trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java	2006-08-25 04:15:30 UTC (rev 56236)
+++ trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java	2006-08-25 04:16:31 UTC (rev 56237)
@@ -449,7 +449,7 @@
       {
          destination.setMessageDestinationName(value);
       }
-      else if (localName.equals("mapped-name"))
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
       {
          destination.setMappedName(value);
       }

Modified: trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java
===================================================================
--- trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java	2006-08-25 04:15:30 UTC (rev 56236)
+++ trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java	2006-08-25 04:16:31 UTC (rev 56237)
@@ -51,6 +51,8 @@
    protected HashMap<String, ResourceEnvRef> resourceEnvRefs = new HashMap<String, ResourceEnvRef>();
    protected HashMap<String, ResourceRef> resourceRefs = new HashMap<String, ResourceRef>();
    protected HashMap<String, MessageDestinationRef> messageDestinationRefs = new HashMap<String, MessageDestinationRef>();
+   /** An index of MessageDestinationRef keyed by message-destination-link values */
+   protected HashMap<String, MessageDestinationRef> messageDestinationRefsByLink = new HashMap<String, MessageDestinationRef>();
    protected HashMap<String, WebServiceRef> webServiceRefs = new HashMap<String, WebServiceRef>();
    protected HashMap<String, JndiRef> jndiRefs = new HashMap<String, JndiRef>();
    protected List<PersistenceContextRef> persistenceContextRefs = new ArrayList<PersistenceContextRef>();
@@ -61,9 +63,15 @@
       return messageDestinationRefs.values();
    }
 
-   public void addMessageDestinationRef(MessageDestinationRef messageDestinationRef)
+   public void addMessageDestinationRef(MessageDestinationRef ref)
    {
-      messageDestinationRefs.put(messageDestinationRef.getMessageDestinationRefName(), messageDestinationRef);
+      log.debug("addMessageDestinationRef, "+ref);
+      messageDestinationRefs.put(ref.getMessageDestinationRefName(), ref);
+      String link = ref.getMessageDestinationLink();
+      if( link != null )
+      {
+         messageDestinationRefsByLink.put(link, ref);
+      }
    }
 
    public Collection<EjbLocalRef> getEjbLocalRefs()
@@ -194,6 +202,7 @@
    
    public void updateMessageDestinationRef(MessageDestinationRef updatedRef)
    {
+      log.debug("updateMessageDestinationRef, "+updatedRef);
       MessageDestinationRef ref = (MessageDestinationRef)messageDestinationRefs.get(updatedRef.getMessageDestinationRefName());
       if (ref != null)
       {
@@ -202,6 +211,7 @@
       else
       {
          messageDestinationRefs.put(updatedRef.getMessageDestinationRefName(), updatedRef);
+         ref = updatedRef;
       }
    }
  
@@ -230,4 +240,10 @@
    {
       persistenceUnitRefs.add(ref);
    }
+
+   public MessageDestinationRef getMessageDestinationRefForLink(String link)
+   {
+      MessageDestinationRef ref = messageDestinationRefsByLink.get(link);
+      return ref;
+   }
 }

Modified: trunk/server/src/main/org/jboss/metamodel/descriptor/MessageDestinationRef.java
===================================================================
--- trunk/server/src/main/org/jboss/metamodel/descriptor/MessageDestinationRef.java	2006-08-25 04:15:30 UTC (rev 56236)
+++ trunk/server/src/main/org/jboss/metamodel/descriptor/MessageDestinationRef.java	2006-08-25 04:16:31 UTC (rev 56237)
@@ -136,6 +136,9 @@
       sb.append("[");
       sb.append("messageDestinationRefName=").append(messageDestinationRefName);
       sb.append(", messageDestinationType=").append(messageDestinationType);
+      sb.append(", messageDestinationLink=").append(messageDestinationLink);
+      sb.append(", messageDestinationUsage=").append(messageDestinationUsage);
+      sb.append(", mappedName=").append(mappedName);
       sb.append("]");
       return sb.toString();
    }




More information about the jboss-cvs-commits mailing list