tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r813350 - in /tuscany/java/sca/modules/binding-jms/src: main/java/org/apache/tuscany/sca/binding/jms/impl/ main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/ main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml...
Date Thu, 10 Sep 2009 10:10:21 GMT
Author: antelder
Date: Thu Sep 10 10:10:21 2009
New Revision: 813350

URL: http://svn.apache.org/viewvc?rev=813350&view=rev
Log:
More updates to bring up the jms binding from 1.x to 2.x

Modified:
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml/WireFormatJMSBytesXML.java
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java
    tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
    tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorWriteTestCase.java

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java
Thu Sep 10 10:10:21 2009
@@ -29,8 +29,11 @@
 import javax.xml.namespace.QName;
 
 import org.apache.tuscany.sca.assembly.BindingRRB;
+import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.OperationsConfigurator;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.policy.PolicySubject;
@@ -41,7 +44,9 @@
  * @version $Rev$ $Date$
  */
 
-public class JMSBinding implements BindingRRB, PolicySubject, OperationsConfigurator, DefinitionElement
{
+//public class JMSBinding implements BindingRRB, PolicySubject, OperationsConfigurator, DefinitionElement
{
+public class JMSBinding implements BindingRRB, PolicySubject, OperationsConfigurator {
+    QName TYPE = new QName(SCA11_NS, "binding.jms");
 
     @Override
     public Object clone() throws CloneNotSupportedException {
@@ -60,7 +65,6 @@
     
     // properties required by IntentAttachPoint 
     private List<Intent> requiredIntents = new ArrayList<Intent>();
-    private IntentAttachPointType intentAttachPointType;
 
     // properties required to describe configured operations
     private List<ConfiguredOperation>  configuredOperations = new ArrayList<ConfiguredOperation>();
@@ -145,6 +149,7 @@
     private WireFormat requestWireFormat;
     private WireFormat responseWireFormat;
     private OperationSelector operationSelector;
+    private ExtensionType extensionType;
     
     public JMSBinding() {
         super();
@@ -764,14 +769,10 @@
         return requiredIntents;
     } 
 
-    public IntentAttachPointType getType() {
-        return intentAttachPointType;
+    public QName getType() {
+        return TYPE;
     }
     
-    public void setType(IntentAttachPointType intentAttachPointType) {
-        this.intentAttachPointType = intentAttachPointType;
-    }
-     
     public Map<String, BindingProperty> getDestinationProperties() {
         return destinationProperties;
     }
@@ -963,4 +964,11 @@
         return true;
     }
 
+    public ExtensionType getExtensionType() {
+        return extensionType;
+    }
+
+    public void setExtensionType(ExtensionType intentAttachPointType) {
+        this.extensionType = intentAttachPointType;
+    }
 }

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
Thu Sep 10 10:10:21 2009
@@ -34,9 +34,13 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.OperationsConfigurator;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.ConfiguredOperationProcessor;
 import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
 import org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefault;
 import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefault;
 import org.apache.tuscany.sca.binding.jms.wireformat.jmsobject.WireFormatJMSObject;
@@ -52,7 +56,6 @@
 import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.monitor.Problem;
 import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.monitor.impl.ProblemImpl;
 import org.apache.tuscany.sca.policy.PolicyFactory;
 
 /**
@@ -132,7 +135,7 @@
 
 public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<JMSBinding>
{
     private PolicyFactory policyFactory;
-    private PolicyAttachPointProcessor policyProcessor;
+    private PolicySubjectProcessor policyProcessor;
     private ConfiguredOperationProcessor configuredOperationProcessor;
     protected StAXArtifactProcessor<Object> extensionProcessor;
     private Monitor monitor;
@@ -140,7 +143,8 @@
     private FactoryExtensionPoint modelFactories; // DOB
     public JMSBindingProcessor(FactoryExtensionPoint modelFactories, StAXArtifactProcessor<Object>
extensionProcessor, Monitor monitor) {
         this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
-        this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
+        this.policyProcessor = new PolicySubjectProcessor(policyFactory);
+
         this.configuredOperationProcessor = 
             new ConfiguredOperationProcessor(modelFactories, this.monitor);
         this.extensionProcessor = extensionProcessor;
@@ -157,7 +161,7 @@
     */
     private void warning(String message, Object model, Object... messageParameters) {
         if (monitor != null) {
-            Problem problem = new ProblemImpl(this.getClass().getName(), "binding-jms-validation-messages",
Severity.WARNING, model, message, (Object[])messageParameters);
+            Problem problem = monitor.createProblem(this.getClass().getName(), "binding-jms-validation-messages",
Severity.WARNING, model, message, (Object[])messageParameters);
     	    monitor.problem(problem);
         }        
     }
@@ -172,7 +176,7 @@
     */
     private void error(String message, Object model, Object... messageParameters) {
         if (monitor != null) {
-            Problem problem = new ProblemImpl(this.getClass().getName(), "binding-jms-validation-messages",
Severity.ERROR, model, message, (Object[])messageParameters);
+            Problem problem = monitor.createProblem(this.getClass().getName(), "binding-jms-validation-messages",
Severity.ERROR, model, message, (Object[])messageParameters);
      	    monitor.problem(problem);
         }        
     }
@@ -919,7 +923,7 @@
     public void write(JMSBinding jmsBinding, XMLStreamWriter writer) throws ContributionWriteException,
         XMLStreamException {
         // Write a <binding.jms>
-        writeStart(writer, Constants.SCA10_NS, JMSBindingConstants.BINDING_JMS,
+        writeStart(writer, Constants.SCA11_NS, JMSBindingConstants.BINDING_JMS,
                    new XAttr("requestConnection", jmsBinding.getRequestConnectionName()),
                    new XAttr("responseConnection", jmsBinding.getResponseConnectionName()),
                    new XAttr("operationProperties", jmsBinding.getOperationPropertiesName()));
@@ -976,7 +980,7 @@
               responseCFName != null  ||
               responseASName != null ) {
             
-           writer.writeStartElement(Constants.SCA10_NS, "response");
+           writer.writeStartElement(Constants.SCA11_NS, "response");
            writeResponseDestinationProperties( jmsBinding, writer );       
            writeResponseConnectionFactoryProperties( jmsBinding, writer );        
            writeResponseActivationSpecProperties( jmsBinding, writer );
@@ -1020,7 +1024,7 @@
      */
     private void writeHeaders( JMSBinding jmsBinding, XMLStreamWriter writer) throws XMLStreamException
{
 
-        writer.writeStartElement(Constants.SCA10_NS, JMSBindingConstants.HEADERS);
+        writer.writeStartElement(Constants.SCA11_NS, JMSBindingConstants.HEADERS);
 
         String jmsType = jmsBinding.getJMSType();
         if (jmsType != null && jmsType.length() > 0) {
@@ -1077,7 +1081,7 @@
             Object key = entry.getKey();
             Object value = entry.getValue();
 
-            writer.writeStartElement(Constants.SCA10_NS, "property" );
+            writer.writeStartElement(Constants.SCA11_NS, "property" );
             writer.writeAttribute("name", key.toString());
 
             if ( value instanceof String) {
@@ -1144,7 +1148,7 @@
         for(Iterator<String> it=operationNames.iterator(); it.hasNext(); ) {
             String opName = it.next();
         
-            writer.writeStartElement(Constants.SCA10_NS, "operationProperties");
+            writer.writeStartElement(Constants.SCA11_NS, "operationProperties");
             writer.writeAttribute("name", opName);
 
             String nativeOperation = jmsBinding.getNativeOperationName(opName);
@@ -1171,7 +1175,7 @@
                     jmsDeliveryMode != null || jmsTimeToLive != null || 
                     jmsPriority != null) {
                     
-                    writer.writeStartElement(Constants.SCA10_NS, JMSBindingConstants.HEADERS);
             
+                    writer.writeStartElement(Constants.SCA11_NS, JMSBindingConstants.HEADERS);
             
                     
                     if (jmsType != null && jmsType.length() > 0) {
                         writer.writeAttribute("JMSType", jmsType);
@@ -1228,7 +1232,7 @@
             Object key = entry.getKey();
             Object value = entry.getValue();
 
-            writer.writeStartElement(Constants.SCA10_NS, "property" );
+            writer.writeStartElement(Constants.SCA11_NS, "property" );
             if (key != null){
                 writer.writeAttribute("name", key.toString());
             }
@@ -1259,7 +1263,7 @@
     private void writeSubscriptionHeaders( JMSBinding jmsBinding, XMLStreamWriter writer)
throws XMLStreamException {
         String jmsSubscriptionHeaders = jmsBinding.getJMSSelector();
         if (jmsSubscriptionHeaders != null && jmsSubscriptionHeaders.length() >
0) {
-            writer.writeStartElement(Constants.SCA10_NS, "SubscriptionHeaders");
+            writer.writeStartElement(Constants.SCA11_NS, "SubscriptionHeaders");
             writer.writeAttribute("JMSSelector", jmsSubscriptionHeaders);
             writer.writeEndElement();
             // Strange bug. Without white space, headers end tag improperly read. 
@@ -1282,7 +1286,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "destination");
+        writer.writeStartElement(Constants.SCA11_NS, "destination");
 
         if ( destinationName != null && destinationName.length() > 0) {
             writer.writeAttribute("name", destinationName);            
@@ -1321,7 +1325,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "connectionFactory");
+        writer.writeStartElement(Constants.SCA11_NS, "connectionFactory");
 
         if ( cfName != null && cfName.length() > 0) {
             writer.writeAttribute("name", cfName);            
@@ -1355,7 +1359,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "activationSpec");
+        writer.writeStartElement(Constants.SCA11_NS, "activationSpec");
 
         if ( asName != null && asName.length() > 0) {
             writer.writeAttribute("name", asName);            
@@ -1390,7 +1394,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "destination");
+        writer.writeStartElement(Constants.SCA11_NS, "destination");
 
         if ( destinationName != null && destinationName.length() > 0) {
             writer.writeAttribute("name", destinationName);            
@@ -1429,7 +1433,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "connectionFactory");
+        writer.writeStartElement(Constants.SCA11_NS, "connectionFactory");
 
         if ( cfName != null && cfName.length() > 0) {
             writer.writeAttribute("name", cfName);            
@@ -1462,7 +1466,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "activationSpec");
+        writer.writeStartElement(Constants.SCA11_NS, "activationSpec");
 
         if ( asName != null && asName.length() > 0) {
             writer.writeAttribute("name", asName);            
@@ -1494,7 +1498,7 @@
             return;
         }
 
-        writer.writeStartElement(Constants.SCA10_NS, "resourceAdapter");
+        writer.writeStartElement(Constants.SCA11_NS, "resourceAdapter");
 
         if ( asName != null && asName.length() > 0) {
             writer.writeAttribute("name", asName);            

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java
Thu Sep 10 10:10:21 2009
@@ -20,8 +20,8 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.Constants;
 
 /**
  * Implementation for policies that could be injected as parameter

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml/WireFormatJMSBytesXML.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml/WireFormatJMSBytesXML.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml/WireFormatJMSBytesXML.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytesxml/WireFormatJMSBytesXML.java
Thu Sep 10 10:10:21 2009
@@ -20,8 +20,8 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.Constants;
 
 
 public class WireFormatJMSBytesXML implements WireFormat {

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java
Thu Sep 10 10:10:21 2009
@@ -20,8 +20,8 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.Constants;
 
 /**
  *

Modified: tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java
Thu Sep 10 10:10:21 2009
@@ -30,6 +30,7 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.OperationsConfigurator;
 import org.apache.tuscany.sca.assembly.WireFormat;
 import org.apache.tuscany.sca.binding.jms.wireformat.jmsbytes.WireFormatJMSBytes;
 import org.apache.tuscany.sca.binding.jms.wireformat.jmsobject.WireFormatJMSObject;
@@ -402,7 +403,7 @@
         inputFactory = XMLInputFactory.newInstance();
         // Create a monitor
         UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();  
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
         if (monitorFactory != null) {
         	monitor = monitorFactory.createMonitor();
         	utilities.addUtility(monitorFactory);

Modified: tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorWriteTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorWriteTestCase.java?rev=813350&r1=813349&r2=813350&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorWriteTestCase.java
(original)
+++ tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorWriteTestCase.java
Thu Sep 10 10:10:21 2009
@@ -77,7 +77,7 @@
         outputFactory = XMLOutputFactory.newInstance();
         // Create a monitor
         UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();  
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
         if (monitorFactory != null) {
         	monitor = monitorFactory.createMonitor();
         	utilities.addUtility(monitorFactory);
@@ -92,6 +92,7 @@
      */
     public void testLoadValidComposite() throws Exception {
         XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(JMSBindingProcessorTestCase.COMPOSITE));
      
+        Object o = staxProcessor.read(reader);
         Composite composite = (Composite)staxProcessor.read(reader);
         JMSBinding binding = (JMSBinding)composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
      
         assertNotNull(binding);



Mime
View raw message