tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r988962 - in /tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main: java/org/apache/tuscany/sca/binding/jms/ resources/
Date Wed, 25 Aug 2010 09:59:59 GMT
Author: antelder
Date: Wed Aug 25 09:59:59 2010
New Revision: 988962

URL: http://svn.apache.org/viewvc?rev=988962&view=rev
Log:
Updates to create mode validation

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.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

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.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/JMSBindingConstants.java?rev=988962&r1=988961&r2=988962&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java
Wed Aug 25 09:59:59 2010
@@ -47,7 +47,7 @@ public interface JMSBindingConstants {
         Arrays.asList(new String[] {DESTINATION_TYPE_QUEUE, DESTINATION_TYPE_TOPIC});
     String CREATE_ALWAYS = "always";
     String CREATE_NEVER = "never";
-    String CREATE_IF_NOT_EXIST = "ifnotexist";
+    String CREATE_IF_NOT_EXIST = "ifNotExist";
     String DEFAULT_CONTEXT_FACTORY_NAME = "org.apache.activemq.jndi.ActiveMQInitialContextFactory";
     String DEFAULT_JNDI_URL = "tcp://localhost:61616";
     int DEFAULT_TIME_TO_LIVE = 20000; // in milliseconds
@@ -65,7 +65,7 @@ public interface JMSBindingConstants {
     String FAULT_PROPERTY = "org_apache_tuscany_sca_fault";
     
     String CALLBACK_ID_PROPERTY = "CallbackID";
-    String CALLBACK_Q_PROPERTY = "scaCallbackQueue";
+    String CALLBACK_Q_PROPERTY = "scaCallbackDestination";
     String CONVERSATION_ID_PROPERTY = "scaConversationId";
     
     // XML element and attribute names

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=988962&r1=988961&r2=988962&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
Wed Aug 25 09:59:59 2010
@@ -440,10 +440,17 @@ public class JMSBindingProcessor extends
 
         String create = reader.getAttributeValue(null, "create");
         if (create != null && create.length() > 0) {
+        	validateCreate(create, reader, monitor);
             jmsBinding.setDestinationCreate(create);
         }
 
         jmsBinding.getDestinationProperties().putAll(parseBindingProperties(reader, monitor));
+        
+        if (jmsBinding.getDestinationCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST))
{
+            if (name == null || name.length() < 1) {
+                error(monitor, "MissingNameForCreate", reader);
+            }
+        }
     }
 
     private void parseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding, Monitor
monitor) throws XMLStreamException {
@@ -486,13 +493,27 @@ public class JMSBindingProcessor extends
 
         String create = reader.getAttributeValue(null, "create");
         if (create != null && create.length() > 0) {
+        	validateCreate(create, reader, monitor);
             jmsBinding.setResponseDestinationCreate(create);
         }
 
         jmsBinding.getResponseDestinationProperties().putAll(parseBindingProperties(reader,
monitor));
     }
 
-    private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding,
Monitor monitor) throws XMLStreamException {
+    private void validateCreate(String create, XMLStreamReader reader, Monitor monitor) {
+    	if (JMSBindingConstants.CREATE_ALWAYS.equals(create)) {
+    		return;
+    	}
+    	if (JMSBindingConstants.CREATE_NEVER.equals(create)) {
+    		return;
+    	}
+    	if (JMSBindingConstants.CREATE_IF_NOT_EXIST.equals(create)) {
+    		return;
+    	}
+    	error(monitor, "InvalidCreate", reader, create);
+	}
+
+	private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding,
Monitor monitor) throws XMLStreamException {
         String name = getURIString(reader, "jndiName");
         if (name != null && name.length() > 0) {
             jmsBinding.setResponseConnectionFactoryName(name);            

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=988962&r1=988961&r2=988962&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
Wed Aug 25 09:59:59 2010
@@ -52,3 +52,5 @@ DuplicateOperationProperties = Must not 
 WireFormatAlreadyDefined = The request wireformat has already been defined. Only one request
wire format can be specified.
 OpSelectorAlreadyDefined = More than one operation selector has been specified. Only one
operation selector can be specified.
 ResponseWireformatAlreadyDefined = The response wireformat has already been defined. Only
one response wire format can be specified.
+MissingNameForCreate = Must specify jndiName attribute when create mode is "ifNotExist"
+InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist'
\ No newline at end of file



Mime
View raw message