tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r984756 - in /tuscany/sca-java-2.x/trunk/modules/binding-jms/src: main/java/org/apache/tuscany/sca/binding/jms/ main/resources/ test/java/org/apache/tuscany/sca/binding/jms/
Date Thu, 12 Aug 2010 13:13:13 GMT
Author: antelder
Date: Thu Aug 12 13:13:13 2010
New Revision: 984756

URL: http://svn.apache.org/viewvc?rev=984756&view=rev
Log:
More correctly handle the jms uri format of the binding. Still needs more work as there jms
uri can be quite complicated and has a whole spec of its own that we should implement

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java?rev=984756&r1=984755&r2=984756&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
Thu Aug 12 13:13:13 2010
@@ -150,6 +150,7 @@ public class JMSBinding implements Bindi
     private WireFormat responseWireFormat;
     private OperationSelector operationSelector;
     private ExtensionType extensionType;
+    private String jmsURI;
     
     public JMSBinding() {
         super();
@@ -971,4 +972,11 @@ public class JMSBinding implements Bindi
     public void setExtensionType(ExtensionType intentAttachPointType) {
         this.extensionType = intentAttachPointType;
     }
+
+    public String getJMSURI() {
+        return jmsURI;
+    }
+    public void setJMSURI(String jmsURI) {
+        this.jmsURI = jmsURI;
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java?rev=984756&r1=984755&r2=984756&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
Thu Aug 12 13:13:13 2010
@@ -356,9 +356,9 @@ public class JMSBindingProcessor extends
     }
 
     protected void parseURI(String uri, JMSBinding jmsBinding, Monitor monitor) {
-        if (!uri.startsWith("jms:")) {
-        	error(monitor, "MustStartWithSchema", jmsBinding, uri);
-        	return;
+        if (!(uri.startsWith("jms:jndi:") || uri.startsWith("jms:queue:") || uri.startsWith("jms:topic:")))
{
+            error(monitor, "MustStartWithSchema", jmsBinding, uri);
+            return;
         }
         int i = uri.indexOf('?');            
         if (i >= 0) {
@@ -378,10 +378,15 @@ public class JMSBindingProcessor extends
                  	return;
         	     }
         	}
-        	jmsBinding.setDestinationName(uri.substring(4, i));
+        	int j=uri.indexOf(':', 4);
+        	jmsBinding.setDestinationName(uri.substring(j+1, i));
+        	jmsBinding.setDestinationType(uri.substring(4, j));
         } else {
-           jmsBinding.setDestinationName(uri.substring(4));
+           int j=uri.indexOf(':', 4);
+           jmsBinding.setDestinationName(uri.substring(j+1));
+           jmsBinding.setDestinationType(uri.substring(4, j));
         }
+        jmsBinding.setJMSURI(uri);
     }
 
     public void resolve(JMSBinding model, ModelResolver resolver, ProcessorContext context)
throws ContributionResolveException {
@@ -922,8 +927,10 @@ public class JMSBindingProcessor extends
             writer.writeAttribute("name", jmsBinding.getName());
         }
 
-        if (jmsBinding.getURI() != null) {
-            writer.writeAttribute("uri", jmsBinding.getURI());
+        if (jmsBinding.getJMSURI() != null) {
+            writer.writeAttribute("uri", jmsBinding.getJMSURI());
+            writeEnd(writer);
+            return;
         }
 
         //String dest = jmsBinding.getDestinationName();

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties?rev=984756&r1=984755&r2=984756&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
Thu Aug 12 13:13:13 2010
@@ -33,7 +33,7 @@ InvalidDestinationType = Invalid destina
 MissingActivationSpecName = Missing ActivationSpec Name
 MissingResponseActivationSpec = Missing response ActivationSpec name
 UnknownTokenInURI = Unknown token {0} in uri: {1}
-MustStartWithSchema = URI must start with the scheme 'jms:' for uri: {0}
+MustStartWithSchema = URI must start with the scheme 'jms:jndi:' or 'jms:queue:' or 'jms:topic:'
 for uri: {0}
 InvalidCorrelationScheme = Invalid correlationScheme: {0}
 UnexpectedElement = Incomplete binding.jms definition found unexpected element: {0}
 UnexpectedResponseElement = Incomplete binding.jms/response definition found unexpected element:
{0}

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java?rev=984756&r1=984755&r2=984756&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
Thu Aug 12 13:13:13 2010
@@ -53,7 +53,7 @@ public class JMSBindingProcessorTestCase
             + " <component name=\"HelloWorldComponent\">"
             + "   <implementation.java class=\"services.HelloWorld\"/>"
             + "      <service name=\"HelloWorldService\">"
-            + "          <binding.jms uri=\"jms:testQueue\" />"
+            + "          <binding.jms uri=\"jms:jndi:testQueue\" />"
             + "      </service>"
             + " </component>"
             + "</composite>";



Mime
View raw message