[jbossws-commits] JBossWS SVN: r12921 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Sep 7 12:00:38 EDT 2010


Author: alessio.soldano at jboss.com
Date: 2010-09-07 12:00:38 -0400 (Tue, 07 Sep 2010)
New Revision: 12921

Modified:
   framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
Log:
[JBWS-3121] Remove endpoints with duplicated addresses


Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java	2010-09-07 15:55:54 UTC (rev 12920)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java	2010-09-07 16:00:38 UTC (rev 12921)
@@ -21,6 +21,8 @@
  */
 package org.jboss.wsf.framework.deployment;
 
+import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -72,6 +74,8 @@
          port = serverConfig.getWebServicePort();
          securePort = serverConfig.getWebServiceSecurePort();
       }
+      Map<String, Endpoint> endpointsMap = new HashMap<String, Endpoint>();
+      List<Endpoint> deleteList = new LinkedList<Endpoint>();
       for (Endpoint ep : dep.getService().getEndpoints())
       {
          boolean confidential = isConfidentialTransportGuarantee(dep, ep);
@@ -87,8 +91,25 @@
             urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
 
          protocol = confidential ? "https://" : "http://";
-         httpEp.setAddress(protocol + hostAndPort + contextRoot + urlPattern);
+         String address = protocol + hostAndPort + contextRoot + urlPattern;
+         httpEp.setAddress(address);
+         //JBWS-2957: EJB3 binds the same endpoint class to multiple beans at multiple JNDI locations;
+         //generally speaking we can't have multiple endpoints published at the same address and we
+         //can't ensure that completely in AS integration, since the publish address is final just here
+         if (!endpointsMap.containsKey(address))
+         {
+            endpointsMap.put(address, httpEp);
+         }
+         else
+         {
+            deleteList.add(httpEp);
+         }
       }
+      //Remove endpoints with duplicated address
+      for (Endpoint ep : deleteList)
+      {
+         dep.getService().getEndpoints().remove(ep);
+      }
    }
    
    protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)



More information about the jbossws-commits mailing list