servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r691065 - in /servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn: AbstractCreatePullPoint.java jms/JmsCreatePullPoint.java
Date Mon, 01 Sep 2008 21:26:33 GMT
Author: gnodet
Date: Mon Sep  1 14:26:33 2008
New Revision: 691065

URL: http://svn.apache.org/viewvc?rev=691065&view=rev
Log:
SM-1117: The pull point name generated by AbstractCreatePullpoint does not work well for some
JMS providers

Modified:
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
    servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java?rev=691065&r1=691064&r2=691065&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
Mon Sep  1 14:26:33 2008
@@ -24,6 +24,7 @@
 import javax.jws.WebParam;
 import javax.jws.WebResult;
 import javax.jws.WebService;
+import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
@@ -41,6 +42,8 @@
 @WebService(endpointInterface = "org.oasis_open.docs.wsn.bw_2.CreatePullPoint")
 public abstract class AbstractCreatePullPoint extends AbstractEndpoint implements CreatePullPoint
{
 
+    public static final QName PULL_POINT_NAME = new QName("http://servicemix.apache.org/wsn",
"PullPointName");
+
     private static Log log = LogFactory.getLog(AbstractCreatePullPoint.class);
 
     private IdGenerator idGenerator;
@@ -86,7 +89,7 @@
         AbstractPullPoint pullPoint = null;
         boolean success = false;
         try {
-            pullPoint = createPullPoint(idGenerator.generateSanitizedId());
+            pullPoint = createPullPoint(createPullPointName(createPullPointRequest));
             for (Iterator it = createPullPointRequest.getAny().iterator(); it.hasNext();)
{
                 Element el = (Element) it.next();
                 if ("address".equals(el.getLocalName())
@@ -121,6 +124,16 @@
         }
     }
 
+    protected String createPullPointName(org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest)
{
+        // Let the creator decide which pull point name to use
+        String name = createPullPointRequest.getOtherAttributes().get(PULL_POINT_NAME);
+        if (name == null) {
+            // If no name is given, just generate one
+            name = idGenerator.generateSanitizedId();
+        }
+        return name;
+    }
+
     public void destroyPullPoint(String address) throws UnableToDestroyPullPointFault {
         AbstractPullPoint pullPoint = pullPoints.remove(address);
         if (pullPoint != null) {

Modified: servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java?rev=691065&r1=691064&r2=691065&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java
(original)
+++ servicemix/components/engines/servicemix-wsn2005/trunk/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java
Mon Sep  1 14:26:33 2008
@@ -18,9 +18,11 @@
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
+import javax.xml.namespace.QName;
 
 import org.apache.servicemix.wsn.AbstractCreatePullPoint;
 import org.apache.servicemix.wsn.AbstractPullPoint;
+import org.oasis_open.docs.wsn.b_2.CreatePullPoint;
 
 public class JmsCreatePullPoint extends AbstractCreatePullPoint {
 
@@ -48,6 +50,15 @@
     }
 
     @Override
+    protected String createPullPointName(CreatePullPoint createPullPointRequest) {
+        // For JMS, avoid using dashes in the pullpoint name (which is also the queue name,
+        // as it will lead to problems with some JMS providers
+        String name = super.createPullPointName(createPullPointRequest);
+        name = name.replace("-", "");
+        return name;
+    }
+
+    @Override
     protected AbstractPullPoint createPullPoint(String name) {
         JmsPullPoint pullPoint = new JmsPullPoint(name);
         pullPoint.setManager(getManager());



Mime
View raw message