tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r712538 [1/3] - in /tuscany/java/sca: itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/ itest/jms-format/src/main/resources/jmstextxml/ modules/assembly-xsd/src/main/resources/ modules/binding-jms...
Date Sun, 09 Nov 2008 19:27:30 GMT
Author: slaws
Date: Sun Nov  9 11:27:28 2008
New Revision: 712538

URL: http://svn.apache.org/viewvc?rev=712538&view=rev
Log:
Tidy wire format support (move model into binding-jms and rename default to textxml). Extend support to include text and object.

Added:
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProviderFactory.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextReferenceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextReferenceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextServiceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextServiceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLProviderFactory.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLReferenceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLReferenceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLServiceInterceptor.java   (with props)
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLServiceProvider.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/OperationSelectorJMSDefault.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/OperationSelectorJMSDefaultProcessor.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProcessor.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObject.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProcessor.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSText.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProcessor.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXML.java   (with props)
    tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstextxml/WireFormatJMSTextXMLProcessor.java   (with props)
Removed:
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/OperationSelectorJMSDefault.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/OperationSelectorJMSDefaultProcessor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytes.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProcessor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/
    tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
Modified:
    tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
    tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
    tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
    tuscany/java/sca/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite
    tuscany/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProviderFactory.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceInterceptor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceProvider.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceInterceptor.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceProvider.java
    tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.WireFormatProviderFactory
    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/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
    tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
    tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointWireImpl.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java

Modified: tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java (original)
+++ tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java Sun Nov  9 11:27:28 2008
@@ -26,16 +26,10 @@
     @Reference
     protected HelloWorldService helloWorldService1;
     
-    public String getGreetings(String name){
-        helloWorldService1.setGreetings(name.getBytes());
-        
-        try {
-            Thread.sleep(2000);
-        } catch (Exception ex) {
-            // do nothing
-        }
-        
-        return HelloWorldServiceImpl.getGreetings(); 
+    public String getGreetings(String name){     
+        byte[] bytesValue = helloWorldService1.getByteArrayGreetings(name.getBytes());
+        String stringValue = new String(bytesValue);  
+        return stringValue; 
     }    
 }
 

Modified: tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java (original)
+++ tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java Sun Nov  9 11:27:28 2008
@@ -27,8 +27,7 @@
 @Remotable
 public interface HelloWorldService {
 
-    @OneWay
-    public void setGreetings(byte[] msg);
+    public byte[] getByteArrayGreetings(byte[] msg);
     
 }
 

Modified: tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java (original)
+++ tuscany/java/sca/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java Sun Nov  9 11:27:28 2008
@@ -20,17 +20,14 @@
 
 public class HelloWorldServiceImpl implements HelloWorldService {
     
-    private static String greetings = "not set";
-    
-    public void setGreetings(byte[] msg){
+    public byte[] getByteArrayGreetings(byte[] msg){
          
         String name = new String(msg);
-        greetings =  "Hello " + name;
-    }
-    
-    public static String getGreetings(){
-        return greetings;
+        name =  "Hello " + name;
+        
+        return name.getBytes();
     }
 
+
 }
 

Modified: tuscany/java/sca/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite (original)
+++ tuscany/java/sca/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite Sun Nov  9 11:27:28 2008
@@ -28,7 +28,7 @@
         <reference name="helloWorldService1" >
             <binding.jms>
                 <destination name="HelloWorldService1"/>
-                <tuscany:wireFormat.jmsDefault/>
+                <tuscany:wireFormat.jmsTextXML/>
             </binding.jms>
         </reference>  
         <reference name="helloWorldService2" >
@@ -48,7 +48,7 @@
         <service name="HelloWorldService">
             <binding.jms>
                 <destination name="HelloWorldService1"/>
-                <tuscany:wireFormat.jmsDefault/>
+                <tuscany:wireFormat.jmsTextXML/>
             </binding.jms>
         </service>
     </component> 

Modified: tuscany/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd (original)
+++ tuscany/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd Sun Nov  9 11:27:28 2008
@@ -25,12 +25,16 @@
 
    <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-binding-jms.xsd"/>
             
-   <complexType name="WireFormatJMSDefaultType"/>
-
-   <element name="wireFormat.jmsDefault" type="t:WireFormatJMSDefaultType"/>
-            
-   <complexType name="OperationSelectorJMSDefaultType"/>
-               
-   <element name="operationSelector.jmsDefault" type="t:OperationSelectorJMSDefaultType"/> 
-              
+   <complexType name="WireFormatJMSTextXMLType"/>
+   <element name="wireFormat.jmsTextXML" type="t:WireFormatJMSTextXMLType"/>
+   
+   <complexType name="WireFormatJMSTextType"/>
+   <element name="wireFormat.jmsText" type="t:WireFormatJMSTextType"/>
+   
+   <complexType name="WireFormatJMSBytesType"/>
+   <element name="wireFormat.jmsBytes" type="t:WireFormatJMSBytesType"/>
+   
+   <complexType name="WireFormatJMSObjectType"/>
+   <element name="wireFormat.jmsObject" type="t:WireFormatJMSObjectType"/>   
+                          
 </schema>

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/BytesMessageProcessor.java Sun Nov  9 11:27:28 2008
@@ -46,10 +46,6 @@
                 throw new IllegalStateException("expecting JMS BytesMessage: " + msg);
             }
             
-            // TODO - Just an experiment
-            //        how should this be wired into databinding?
-            //        how to enforce single byte array parameter
-            //        also casting long -> int!
             long noOfBytes = ((BytesMessage)msg).getBodyLength();
             byte [] bytes = new byte[(int)noOfBytes];
             ((BytesMessage)msg).readBytes(bytes);
@@ -64,7 +60,7 @@
     protected Message createJMSMessage(Session session, Object o) {
         try {
 
-            // TODO - just and experiment. How to enforce a single
+            // TODO - an experiment. How to enforce a single
             //        byte array parameter
             BytesMessage message = session.createBytesMessage();
             byte [] bytes = (byte[])((Object[])o)[0];

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java Sun Nov  9 11:27:28 2008
@@ -31,7 +31,7 @@
 import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
 import org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefault;
 import org.apache.tuscany.sca.binding.jms.transport.TransportReferenceInterceptor;
-import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefault;
+import org.apache.tuscany.sca.binding.jms.wireformat.jmstextxml.WireFormatJMSTextXML;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
 import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
 import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
@@ -64,7 +64,7 @@
     private List<JMSBindingInvoker> jmsBindingInvokers = new ArrayList<JMSBindingInvoker>();
     private JMSResourceFactory jmsResourceFactory;
     private RuntimeComponent component;
-    private InterfaceContract wsdlInterfaceContract; 
+    private InterfaceContract interfaceContract; 
     private ExtensionPointRegistry extensions;
     
     private ProviderFactoryExtensionPoint providerFactories;
@@ -81,39 +81,12 @@
         this.extensions = extensions;
         this.component = component;
         this.jmsResourceFactory = jmsResourceFactory;
-
-        // TODO - need to look at what the impact of the wireformat 
-        //        on the binding interface contract is
-        if ((jmsBinding.getRequestWireFormat() == null) ||
-            (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSDefault)) {
-            if (XMLTextMessageProcessor.class.isAssignableFrom(JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding).getClass())) {
-                setXMLDataBinding(reference);
-            }
-        }
-        
-        // Get the factories/providers for operation selection
-        
-        // if no operation selector is specified then assume the default
-        if (jmsBinding.getOperationSelector() == null){
-            jmsBinding.setOperationSelector(new OperationSelectorJMSDefault());
-        }
         
+        // Get the factories/providers for operation selection        
         this.providerFactories = extensions.getExtensionPoint(ProviderFactoryExtensionPoint.class);
         
         // Get the factories/providers for wire format
-        
-        // TODO - Move into the binding
-        // if no request wire format specified then assume the default
-        if (jmsBinding.getRequestWireFormat() == null){
-            jmsBinding.setRequestWireFormat(new WireFormatJMSDefault());
-        }
-        
-        // if no response wire format specific then assume the default
-        if (jmsBinding.getResponseWireFormat() == null){
-            jmsBinding.setResponseWireFormat(new WireFormatJMSDefault());
-         }
-        
-        this.requestWireFormatProviderFactory = 
+         this.requestWireFormatProviderFactory = 
             (WireFormatProviderFactory)providerFactories.getProviderFactory(jmsBinding.getRequestWireFormat().getClass());
         if (this.requestWireFormatProviderFactory != null){
             this.requestWireFormatProvider = requestWireFormatProviderFactory.createReferenceWireFormatProvider(component, reference, jmsBinding);
@@ -123,31 +96,7 @@
             (WireFormatProviderFactory)providerFactories.getProviderFactory(jmsBinding.getResponseWireFormat().getClass());
         if (this.responseWireFormatProviderFactory != null){
             this.responseWireFormatProvider = responseWireFormatProviderFactory.createReferenceWireFormatProvider(component, reference, jmsBinding);
-        }        
-
-    }
-    
-    protected void setXMLDataBinding(RuntimeComponentReference reference) {
-        
-        WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
-        WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
-        BindingWSDLGenerator.generateWSDL(component, reference, wsBinding, extensions, null);
-        wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
-        wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
-        
-        // TODO: TUSCANY-xxx, section 5.2 "Default Data Binding" in the JMS binding spec  
-        
-//        try {
-//            InterfaceContract ic = (InterfaceContract)reference.getInterfaceContract().clone();
-//
-//            Interface ii = (Interface)ic.getInterface().clone();
-//            ii.resetDataBinding("org.apache.axiom.om.OMElement");
-//            ic.setInterface(ii);
-//            reference.setInterfaceContract(ic);
-//
-//        } catch (CloneNotSupportedException e) {
-//            throw new RuntimeException(e);
-//        }
+        }      
     }
 
     public Invoker createInvoker(Operation operation) {
@@ -158,13 +107,8 @@
             }
         }
 
-        /*
-         * TODO turn on RRB version of JMS binding
-         */
         Invoker invoker = null;
         invoker = new RRBJMSBindingInvoker(jmsBinding, operation, jmsResourceFactory, reference);
-        //invoker = new JMSBindingInvoker(jmsBinding, operation, jmsResourceFactory, reference);
-        //jmsBindingInvokers.add((JMSBindingInvoker)invoker);
        
         return invoker;
     }
@@ -174,15 +118,10 @@
     }
 
     public InterfaceContract getBindingInterfaceContract() {
-        if (wsdlInterfaceContract != null) {
-            return wsdlInterfaceContract;
-        } else {
-            if (reference.getInterfaceContract() == null) {
-                return reference.getReference().getInterfaceContract();
-            } else {
-                return reference.getInterfaceContract();
-            }
+        if (interfaceContract == null){
+            interfaceContract = this.requestWireFormatProvider.getWireFormatInterfaceContract();
         }
+        return interfaceContract;
     }
 
     public void start() {
@@ -198,7 +137,8 @@
     }
     
     /*
-     * RRB test methods
+     * set up the reference binding wire with the right set of jms reference
+     * interceptors
      */
     public void configureBindingChain(RuntimeWire runtimeWire) {
         

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java Sun Nov  9 11:27:28 2008
@@ -44,9 +44,7 @@
 import org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefaultServiceInterceptor;
 import org.apache.tuscany.sca.binding.jms.transport.TransportReferenceInterceptor;
 import org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor;
-import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefault;
-import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefaultReferenceInterceptor;
-import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefaultServiceInterceptor;
+import org.apache.tuscany.sca.binding.jms.wireformat.jmstextxml.WireFormatJMSTextXML;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
 import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
 import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
@@ -123,29 +121,12 @@
                 jmsBinding.setDestinationName(service.getName());
             }
         }
-
-        // TODO - need to look at what the impact of the wireformat 
-        //        on the binding interface contract is
-        if ((jmsBinding.getRequestWireFormat() == null) ||
-                (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSDefault)) {
-            if (XMLTextMessageProcessor.class.isAssignableFrom(JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding).getClass())) {
-                if (!isOnMessage()) {
-                    setXMLDataBinding(service);
-                }
-            }
-        }
         
         // Get Message factory
         modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         messageFactory = modelFactories.getFactory(MessageFactory.class);
 
-        // Get the factories/providers for operation selection
-        
-        // if no operation selector is specified then assume the default
-        if (jmsBinding.getOperationSelector() == null){
-            jmsBinding.setOperationSelector(new OperationSelectorJMSDefault());
-        }
-        
+        // Get the factories/providers for operation selection       
         this.providerFactories = extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
         this.operationSelectorProviderFactory =
             (OperationSelectorProviderFactory)providerFactories.getProviderFactory(jmsBinding.getOperationSelector().getClass());
@@ -153,18 +134,7 @@
             this.operationSelectorProvider = operationSelectorProviderFactory.createServiceOperationSelectorProvider(component, service, jmsBinding);
         }
         
-        // Get the factories/providers for wire format
-        
-        // if no request wire format specified then assume the default
-        if (jmsBinding.getRequestWireFormat() == null){
-            jmsBinding.setRequestWireFormat(new WireFormatJMSDefault());
-        }
-        
-        // if no response wire format specific then assume the default
-        if (jmsBinding.getResponseWireFormat() == null){
-            jmsBinding.setResponseWireFormat(new WireFormatJMSDefault());
-         }
-        
+        // Get the factories/providers for wire format        
         this.requestWireFormatProviderFactory = 
             (WireFormatProviderFactory)providerFactories.getProviderFactory(jmsBinding.getRequestWireFormat().getClass());
         if (this.requestWireFormatProviderFactory != null){
@@ -177,48 +147,9 @@
             this.responseWireFormatProvider = responseWireFormatProviderFactory.createServiceWireFormatProvider(component, service, jmsBinding);
         }
     }
-    
-    protected boolean isOnMessage() {
-        InterfaceContract ic = getBindingInterfaceContract();
-        if (ic.getInterface().getOperations().size() != 1) {
-            return false;
-        }
-        return "onMessage".equals(ic.getInterface().getOperations().get(0).getName());
-    }
-
-    protected void setXMLDataBinding(RuntimeComponentService service) {
-        if (service.getInterfaceContract() != null) {
-            WebServiceBindingFactory wsFactory = extensionPoints.getExtensionPoint(WebServiceBindingFactory.class);
-            WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
-            BindingWSDLGenerator.generateWSDL(component, service, wsBinding, extensionPoints, null);
-            wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
-            wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
-            
-            // TODO: TUSCANY-xxx, section 5.2 "Default Data Binding" in the JMS binding spec  
-
-//            try {
-//                InterfaceContract ic = (InterfaceContract)service.getInterfaceContract().clone();
-//                Interface ii = ic.getInterface();
-//                if (ii.getOperations().size() == 1 && "onMessage".equals(ii.getOperations().get(0).getName())) {
-//                    return;
-//                }
-//                ii = (Interface)ii.clone();
-//                ii.resetDataBinding("org.apache.axiom.om.OMElement");
-//                ic.setInterface(ii);
-//                service.setInterfaceContract(ic);
-//
-//            } catch (CloneNotSupportedException e) {
-//                throw new RuntimeException(e);
-//            }
-        }
-    }
 
     public InterfaceContract getBindingInterfaceContract() {
-        if (wsdlInterfaceContract != null) {
-            return wsdlInterfaceContract;
-        } else {
-            return service.getInterfaceContract();
-        }
+        return requestWireFormatProvider.getWireFormatInterfaceContract();
     }
 
     public boolean supportsOneWayInvocation() {
@@ -408,18 +339,21 @@
         // add transport interceptor
         bindingChain.addInterceptor(Phase.SERVICE_BINDING_TRANSPORT, 
                                     new TransportServiceInterceptor(jmsBinding,
-                                                                              jmsResourceFactory,
-                                                                              runtimeWire) );
+                                                                    jmsResourceFactory,
+                                                                    runtimeWire) );
 
         // add operation selector interceptor
-        bindingChain.addInterceptor(operationSelectorProvider.getPhase(), operationSelectorProvider.createInterceptor());
+        bindingChain.addInterceptor(operationSelectorProvider.getPhase(), 
+                                    operationSelectorProvider.createInterceptor());
         
         // add request wire format
-        bindingChain.addInterceptor(requestWireFormatProvider.getPhase(), requestWireFormatProvider.createInterceptor());
+        bindingChain.addInterceptor(requestWireFormatProvider.getPhase(), 
+                                    requestWireFormatProvider.createInterceptor());
         
         // add response wire format, but only add it if it's different from the request
         if (!jmsBinding.getRequestWireFormat().equals(jmsBinding.getResponseWireFormat())){
-            bindingChain.addInterceptor(responseWireFormatProvider.getPhase(), responseWireFormatProvider.createInterceptor());
+            bindingChain.addInterceptor(responseWireFormatProvider.getPhase(), 
+                                        responseWireFormatProvider.createInterceptor());
         }
     }
 }

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java Sun Nov  9 11:27:28 2008
@@ -93,75 +93,30 @@
         try {
             invokeService(requestJMSMsg);
         } catch (Throwable e) {
-            logger.log(Level.SEVERE, "Exception invoking service '" + service.getName(), e);
-            sendFaultReply(requestJMSMsg, e);
+            logger.log(Level.SEVERE, "Exception send fault response '" + service.getName(), e);
         }
     }
 
     protected void invokeService(Message requestJMSMsg) throws JMSException, InvocationTargetException {
 
-        try {
-            // create the tuscany message
-            org.apache.tuscany.sca.invocation.Message tuscanyMsg = messageFactory.createMessage();
-            
-            // populate the message context with JMS binding information
-            JMSBindingContext context = new JMSBindingContext();
-            tuscanyMsg.getHeaders().add(context);
-            
-            context.setJmsMsg(requestJMSMsg);
-            context.setJmsSession(jmsResourceFactory.createSession());
-            context.setReplyToDestination(requestJMSMsg.getJMSReplyTo());
-            
-            // set the message body
-            tuscanyMsg.setBody(requestJMSMsg);
+        // create the tuscany message
+        org.apache.tuscany.sca.invocation.Message tuscanyMsg = messageFactory.createMessage();
+        
+        // populate the message context with JMS binding information
+        JMSBindingContext context = new JMSBindingContext();
+        tuscanyMsg.getHeaders().add(context);
+        
+        context.setJmsMsg(requestJMSMsg);
+        context.setJmsResourceFactory(jmsResourceFactory);
+        context.setReplyToDestination(requestJMSMsg.getJMSReplyTo());
+        
+        // set the message body
+        tuscanyMsg.setBody(requestJMSMsg);
+        
+        // call the runtime wire - the response is handled by the 
+        // transport interceptor
+        service.getRuntimeWire(targetBinding).invoke(tuscanyMsg);
             
-            // call the runtime wire
-            InvocationChain chain = service.getRuntimeWire(targetBinding).getBindingInvocationChain();
-            chain.getHeadInvoker().invoke(tuscanyMsg);
-            
-        } catch (NamingException e) {
-            throw new JMSBindingException(e);
-        }      
     }   
 
-    /*
-     * Send a message back if a fault has occurred
-     */
-    protected void sendFaultReply(Message requestJMSMsg, Object responsePayload) {
-        try {
-
-            if (requestJMSMsg.getJMSReplyTo() == null) {
-                // assume no reply is expected
-                if (responsePayload != null) {
-                    logger.log(Level.FINE, "JMS service '" + service.getName() + "' dropped response as request has no replyTo");
-                }
-                return;
-            }
-
-            Session session = jmsResourceFactory.createSession();
-            Message replyJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)responsePayload);
-            replyJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
-            replyJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
-
-            if (correlationScheme == null || JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
-                replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
-            } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
-                replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
-            }
-
-            Destination destination = requestJMSMsg.getJMSReplyTo();
-            MessageProducer producer = session.createProducer(destination);
-
-            producer.send(replyJMSMsg);
-
-            producer.close();
-            session.close();
-
-        } catch (JMSException e) {
-            throw new JMSBindingException(e);
-        } catch (NamingException e) {
-            throw new JMSBindingException(e);
-        }
-    }
-
 }

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java Sun Nov  9 11:27:28 2008
@@ -28,6 +28,7 @@
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.Topic;
+import javax.naming.NamingException;
 import javax.security.auth.Subject;
 
 import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
@@ -66,6 +67,7 @@
     private JMSMessageProcessor requestMessageProcessor;
     private JMSMessageProcessor responseMessageProcessor;
     private RuntimeComponentService service;
+    private String correlationScheme;
     
 
     public TransportServiceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeWire runtimeWire) {
@@ -76,16 +78,28 @@
         this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
         this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
         this.service = (RuntimeComponentService)runtimeWire.getTarget().getContract();
+        this.correlationScheme = jmsBinding.getCorrelationScheme();
     }
     
     public Message invoke(Message msg) {
-        return invokeResponse(next.invoke(invokeRequest(msg)));
+        try {
+            return invokeResponse(next.invoke(invokeRequest(msg)));
+        } catch (Throwable e) {
+            logger.log(Level.SEVERE, "Exception invoking service '" + service.getName(), e);
+            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+            javax.jms.Message replyJMSMsg = responseMessageProcessor.createFaultMessage(context.getJmsSession(), 
+                                                                                        (Throwable)e);
+            msg.setBody(replyJMSMsg);
+            invokeResponse(msg);
+            return msg;
+        }
     }    
     
     public Message invokeRequest(Message msg) { 
         try {
             JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
             javax.jms.Message requestJMSMsg = context.getJmsMsg();
+            context.setJmsSession(context.getJmsResourceFactory().createSession());
             
             EndpointReference from = new EndpointReferenceImpl(null);
             msg.setFrom(from);
@@ -100,7 +114,9 @@
             return msg;
         } catch (JMSException e) {
             throw new JMSBindingException(e);
-        }
+        } catch (NamingException e) {
+            throw new JMSBindingException(e);
+        } 
     }
     
     public Message invokeResponse(Message msg) { 
@@ -108,6 +124,8 @@
             JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
             Session session = context.getJmsSession();
             javax.jms.Message requestJMSMsg = context.getJmsMsg();
+            javax.jms.Message responseJMSMsg = msg.getBody();
+            
 
             if (requestJMSMsg.getJMSReplyTo() == null) {
                 // assume no reply is expected
@@ -116,6 +134,16 @@
                 }
                 return msg;
             }
+            
+            responseJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
+            responseJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
+    
+            if (correlationScheme == null || 
+                JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
+                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
+            } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
+                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
+            }                
                        
             MessageProducer producer = session.createProducer(context.getReplyToDestination());
     

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProviderFactory.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProviderFactory.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesProviderFactory.java Sun Nov  9 11:27:28 2008
@@ -43,7 +43,7 @@
     public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
                                                         RuntimeComponentReference reference,
                                                         Binding binding) {
-        return new WireFormatJMSBytesReferenceProvider(component, reference, binding);
+        return new WireFormatJMSBytesReferenceProvider(registry, component, reference, binding);
     }
 
     /**
@@ -51,7 +51,7 @@
     public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
                                                               RuntimeComponentService service,
                                                               Binding binding) {
-        return new WireFormatJMSBytesServiceProvider(component, service, binding);
+        return new WireFormatJMSBytesServiceProvider(registry, component, service, binding);
     }
 
     /**

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceInterceptor.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceInterceptor.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceInterceptor.java Sun Nov  9 11:27:28 2008
@@ -30,7 +30,6 @@
 import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessor;
 import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorUtil;
 import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
-import org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefault;
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.Message;
@@ -48,38 +47,24 @@
     private JMSBinding jmsBinding;
     private JMSMessageProcessor requestMessageProcessor;
     private JMSMessageProcessor responseMessageProcessor;
-    private WireFormat requestWireFormat;
-    private WireFormat responseWireFormat;
 
     public WireFormatJMSBytesReferenceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeWire runtimeWire) {
         super();
         this.jmsBinding = jmsBinding;
         this.runtimeWire = runtimeWire;
         this.jmsResourceFactory = jmsResourceFactory;
-        
-        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSBytes){
-            this.requestWireFormat = jmsBinding.getRequestWireFormat();
-            this.jmsBinding.setRequestMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
-        }
-        
-        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSBytes){
-            this.responseWireFormat = jmsBinding.getResponseWireFormat();
-            this.jmsBinding.setResponseMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
-        }
-        
         this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
-        this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
-         
+        this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding); 
     }
 
     public Message invoke(Message msg) {
-        if (requestWireFormat != null){
+        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSBytes){
             msg = invokeRequest(msg);
         }
         
         msg = getNext().invoke(msg);
         
-        if (responseWireFormat != null){
+        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSBytes){
             msg = invokeResponse(msg);
         }
         

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceProvider.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceProvider.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesReferenceProvider.java Sun Nov  9 11:27:28 2008
@@ -21,8 +21,18 @@
 
 import java.util.List;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorUtil;
+import org.apache.tuscany.sca.binding.jms.provider.XMLTextMessageProcessor;
+import org.apache.tuscany.sca.binding.jms.wireformat.jmstextxml.WireFormatJMSTextXML;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
+import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
@@ -38,33 +48,47 @@
  * @version $Rev$ $Date$
  */
 public class WireFormatJMSBytesReferenceProvider implements WireFormatProvider {
+    private ExtensionPointRegistry registry;
     private RuntimeComponent component;
     private RuntimeComponentReference reference;
-    private Binding binding;
+    private JMSBinding binding;
+    private InterfaceContract interfaceContract; 
 
-    public WireFormatJMSBytesReferenceProvider(RuntimeComponent component,
+    public WireFormatJMSBytesReferenceProvider(ExtensionPointRegistry registry,
+                                               RuntimeComponent component,
                                                RuntimeComponentReference reference,
                                                Binding binding) {
         super();
+        this.registry = registry;
         this.component = component;
         this.reference = reference;
-        this.binding = binding;
+        this.binding = (JMSBinding)binding;
+        
+        // configure the reference based on this wire format
+        
+        // currently maintaining the message processor structure which 
+        // contains the details of jms message processing however overried 
+        // any message processors specied in the SCDL in this case
+        this.binding.setRequestMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
+        this.binding.setResponseMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
+        
+        // just point to the reference interface contract so no 
+        // databinding transformation takes place
+        interfaceContract = reference.getInterfaceContract();
     }
     
-    /**
-     * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
-     */
+    public InterfaceContract getWireFormatInterfaceContract() {
+        return interfaceContract;
+    }
+
     public Interceptor createInterceptor() {
-        return new WireFormatJMSBytesReferenceInterceptor((JMSBinding)binding, 
-                                                           null, 
-                                                           reference.getRuntimeWire(binding));
+        return new WireFormatJMSBytesReferenceInterceptor(binding, 
+                                                          null, 
+                                                          reference.getRuntimeWire(binding));
     }
 
-    /**
-     * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
-     */
     public String getPhase() {
-        return Phase.REFERENCE_POLICY;
+        return Phase.REFERENCE_BINDING_WIREFORMAT;
     }
 
 }

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceInterceptor.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceInterceptor.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceInterceptor.java Sun Nov  9 11:27:28 2008
@@ -47,40 +47,24 @@
     private JMSBinding jmsBinding;
     private JMSMessageProcessor requestMessageProcessor;
     private JMSMessageProcessor responseMessageProcessor;
-    private WireFormat requestWireFormat;
-    private WireFormat responseWireFormat;
-    private String correlationScheme;
 
     public WireFormatJMSBytesServiceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeWire runtimeWire) {
         super();
         this.jmsBinding = jmsBinding;
         this.runtimeWire = runtimeWire;
         this.jmsResourceFactory = jmsResourceFactory;
-        
-        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSBytes){
-            this.requestWireFormat = jmsBinding.getRequestWireFormat();
-            this.jmsBinding.setRequestMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
-        }
-        
-        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSBytes){
-            this.responseWireFormat = jmsBinding.getResponseWireFormat();
-            this.jmsBinding.setResponseMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
-        }
-        
         this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
         this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
-        
-        this.correlationScheme = jmsBinding.getCorrelationScheme();
     }
 
     public Message invoke(Message msg) {
-        if (requestWireFormat != null){
+        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSBytes){
             msg = invokeRequest(msg);
         }
         
         msg = getNext().invoke(msg);
         
-        if (responseWireFormat != null){
+        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSBytes){
             msg = invokeResponse(msg);
         }
         
@@ -99,34 +83,22 @@
     }
     
     public Message invokeResponse(Message msg) {
-        try {
-            // get the jms context
-            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
-            javax.jms.Message requestJMSMsg = context.getJmsMsg();
-            Session session = context.getJmsSession();
-
-            javax.jms.Message responseJMSMsg;
-            if (msg.isFault()) {
-                responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
-            } else {
-                responseJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, msg.getBody());
-            }
-    
-            responseJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
-            responseJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
+        // get the jms context
+        JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+        javax.jms.Message requestJMSMsg = context.getJmsMsg();
+        Session session = context.getJmsSession();
+
+        javax.jms.Message responseJMSMsg;
+        if (msg.isFault()) {
+            responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
+        } else {
+            Object[] response = {msg.getBody()};
+            responseJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, response);
+        } 
     
-            if (correlationScheme == null || JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
-                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
-            } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
-                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
-            }    
+        msg.setBody(responseJMSMsg);
         
-            msg.setBody(responseJMSMsg);
-            
-            return msg;
-        } catch (JMSException e) {
-            throw new JMSBindingException(e);
-        } 
+        return msg;
     }        
 
     public Invoker getNext() {

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceProvider.java?rev=712538&r1=712537&r2=712538&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceProvider.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsbytes/WireFormatJMSBytesServiceProvider.java Sun Nov  9 11:27:28 2008
@@ -23,6 +23,9 @@
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
@@ -38,15 +41,37 @@
  * @version $Rev$ $Date$
  */
 public class WireFormatJMSBytesServiceProvider implements WireFormatProvider {
+    private ExtensionPointRegistry registry;
     private RuntimeComponent component;
     private RuntimeComponentService service;
-    private Binding binding;
+    private JMSBinding binding;
+    private InterfaceContract interfaceContract; 
 
-    public WireFormatJMSBytesServiceProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
+    public WireFormatJMSBytesServiceProvider(ExtensionPointRegistry registry,
+                                             RuntimeComponent component, 
+                                             RuntimeComponentService service, 
+                                             Binding binding) {
         super();
+        this.registry = registry;
         this.component = component;
         this.service = service;
-        this.binding = binding;
+        this.binding = (JMSBinding)binding;
+        
+        // configure the service based on this wire format
+        
+        // currently maintaining the message processor structure which 
+        // contains the details of jms message processing however overried 
+        // any message processors specied in the SCDL in this case
+        this.binding.setRequestMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
+        this.binding.setResponseMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME);
+        
+        // just point to the reference interface contract so no 
+        // databinding transformation takes place
+        interfaceContract = service.getInterfaceContract();
+    }
+    
+    public InterfaceContract getWireFormatInterfaceContract() {
+        return interfaceContract;
     }
 
     /**
@@ -60,7 +85,7 @@
     /**
      */
     public String getPhase() {
-        return Phase.SERVICE_POLICY;
+        return Phase.SERVICE_BINDING_WIREFORMAT;
     }
 
 }

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.jms.wireformat.jmsobject;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.provider.WireFormatProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSObjectProviderFactory implements WireFormatProviderFactory<WireFormatJMSObject> {
+    private ExtensionPointRegistry registry;
+    
+    public WireFormatJMSObjectProviderFactory(ExtensionPointRegistry registry) {
+        super();
+        this.registry = registry;
+    }
+
+    /**
+     */
+    public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
+                                                        RuntimeComponentReference reference,
+                                                        Binding binding) {
+        return new WireFormatJMSObjectReferenceProvider(registry, component, reference, binding);
+    }
+
+    /**
+      */
+    public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
+                                                              RuntimeComponentService service,
+                                                              Binding binding) {
+        return new WireFormatJMSObjectServiceProvider(registry, component, service, binding);
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
+     */
+    public Class getModelType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProviderFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.binding.jms.wireformat.jmsobject;
+
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessor;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorUtil;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSObjectReferenceInterceptor implements Interceptor {
+
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+
+    public WireFormatJMSObjectReferenceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeWire runtimeWire) {
+        super();
+        this.jmsBinding = jmsBinding;
+        this.runtimeWire = runtimeWire;
+        this.jmsResourceFactory = jmsResourceFactory;
+        this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
+        this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding); 
+    }
+
+    public Message invoke(Message msg) {
+        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSObject){
+            msg = invokeRequest(msg);
+        }
+        
+        msg = getNext().invoke(msg);
+        
+        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSObject){
+            msg = invokeResponse(msg);
+        }
+        
+        return msg;
+    }
+    
+    public Message invokeRequest(Message msg) {
+        try {
+            // get the jms context
+            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+            Session session = context.getJmsSession();
+            
+            javax.jms.Message requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, msg.getBody());
+            msg.setBody(requestMsg);
+            
+            requestMsg.setJMSReplyTo(context.getReplyToDestination());
+            
+            return msg;
+        } catch (JMSException e) {
+            throw new JMSBindingException(e);
+        } 
+    }
+    
+    public Message invokeResponse(Message msg) {
+        if (msg.getBody() != null){
+            Object[] response = (Object[])responseMessageProcessor.extractPayloadFromJMSMessage((javax.jms.Message)msg.getBody());
+            if (response != null && response.length > 0){
+                msg.setBody(response[0]);
+            } else {
+                msg.setBody(null);
+            }
+        }
+
+        return msg;
+    }     
+
+    public Invoker getNext() {
+        return next;
+    }
+
+    public void setNext(Invoker next) {
+        this.next = next;
+    }
+}

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.jms.wireformat.jmsobject;
+
+import java.util.List;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorUtil;
+import org.apache.tuscany.sca.binding.jms.provider.XMLTextMessageProcessor;
+import org.apache.tuscany.sca.binding.jms.wireformat.jmstextxml.WireFormatJMSTextXML;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
+import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.util.PolicyHandler;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSObjectReferenceProvider implements WireFormatProvider {
+    private ExtensionPointRegistry registry;
+    private RuntimeComponent component;
+    private RuntimeComponentReference reference;
+    private JMSBinding binding;
+    private InterfaceContract interfaceContract; 
+
+    public WireFormatJMSObjectReferenceProvider(ExtensionPointRegistry registry,
+                                               RuntimeComponent component,
+                                               RuntimeComponentReference reference,
+                                               Binding binding) {
+        super();
+        this.registry = registry;
+        this.component = component;
+        this.reference = reference;
+        this.binding = (JMSBinding)binding;
+        
+        // configure the reference based on this wire format
+        
+        // currently maintaining the message processor structure which 
+        // contains the details of jms message processing however overried 
+        // any message processors specied in the SCDL in this case
+        this.binding.setRequestMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
+        this.binding.setResponseMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
+        
+        // just point to the reference interface contract so no 
+        // databinding transformation takes place
+        interfaceContract = reference.getInterfaceContract();
+    }
+    
+    public InterfaceContract getWireFormatInterfaceContract() {
+        return interfaceContract;
+    }
+
+    public Interceptor createInterceptor() {
+        return new WireFormatJMSObjectReferenceInterceptor(binding, 
+                                                          null, 
+                                                          reference.getRuntimeWire(binding));
+    }
+
+    public String getPhase() {
+        return Phase.REFERENCE_BINDING_WIREFORMAT;
+    }
+
+}

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectReferenceProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.binding.jms.wireformat.jmsobject;
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessor;
+import org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorUtil;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+ * Policy handler to handle PolicySet related to Logging with the QName
+ * {http://tuscany.apache.org/xmlns/sca/1.0/impl/java}LoggingPolicy
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSObjectServiceInterceptor implements Interceptor {
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+
+    public WireFormatJMSObjectServiceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeWire runtimeWire) {
+        super();
+        this.jmsBinding = jmsBinding;
+        this.runtimeWire = runtimeWire;
+        this.jmsResourceFactory = jmsResourceFactory;
+        this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
+        this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
+    }
+
+    public Message invoke(Message msg) {
+        if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSObject){
+            msg = invokeRequest(msg);
+        }
+        
+        msg = getNext().invoke(msg);
+        
+        if (jmsBinding.getResponseWireFormat() instanceof WireFormatJMSObject){
+            msg = invokeResponse(msg);
+        }
+        
+        return msg;
+    }
+    
+    public Message invokeRequest(Message msg) {
+        // get the jms context
+        JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+        javax.jms.Message jmsMsg = context.getJmsMsg();
+
+        Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg);
+        msg.setBody(requestPayload);
+                 
+        return msg;
+    }
+    
+    public Message invokeResponse(Message msg) {
+        // get the jms context
+        JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+        javax.jms.Message requestJMSMsg = context.getJmsMsg();
+        Session session = context.getJmsSession();
+
+        javax.jms.Message responseJMSMsg;
+        if (msg.isFault()) {
+            responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
+        } else {
+            Object[] response = {msg.getBody()};
+            responseJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, response);
+        } 
+    
+        msg.setBody(responseJMSMsg);
+        
+        return msg;
+    }        
+
+    public Invoker getNext() {
+        return next;
+    }
+
+    public void setNext(Invoker next) {
+        this.next = next;
+    }
+}

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.jms.wireformat.jmsobject;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.util.PolicyHandler;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSObjectServiceProvider implements WireFormatProvider {
+    private ExtensionPointRegistry registry;
+    private RuntimeComponent component;
+    private RuntimeComponentService service;
+    private JMSBinding binding;
+    private InterfaceContract interfaceContract; 
+
+    public WireFormatJMSObjectServiceProvider(ExtensionPointRegistry registry,
+                                             RuntimeComponent component, 
+                                             RuntimeComponentService service, 
+                                             Binding binding) {
+        super();
+        this.registry = registry;
+        this.component = component;
+        this.service = service;
+        this.binding = (JMSBinding)binding;
+        
+        // configure the service based on this wire format
+        
+        // currently maintaining the message processor structure which 
+        // contains the details of jms message processing however overried 
+        // any message processors specied in the SCDL in this case
+        this.binding.setRequestMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
+        this.binding.setResponseMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
+
+        // just point to the reference interface contract so no 
+        // databinding transformation takes place
+        interfaceContract = service.getInterfaceContract();
+    }
+    
+    public InterfaceContract getWireFormatInterfaceContract() {
+        return interfaceContract;
+    }
+
+    /**
+     */
+    public Interceptor createInterceptor() {
+        return new WireFormatJMSObjectServiceInterceptor((JMSBinding)binding,
+                                                         null,
+                                                        service.getRuntimeWire(binding));
+    }
+
+    /**
+     */
+    public String getPhase() {
+        return Phase.SERVICE_BINDING_WIREFORMAT;
+    }
+
+}

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectServiceProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProviderFactory.java?rev=712538&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProviderFactory.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmstext/WireFormatJMSTextProviderFactory.java Sun Nov  9 11:27:28 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.jms.wireformat.jmstext;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.provider.WireFormatProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSTextProviderFactory implements WireFormatProviderFactory<WireFormatJMSText> {
+    private ExtensionPointRegistry registry;
+    
+    public WireFormatJMSTextProviderFactory(ExtensionPointRegistry registry) {
+        super();
+        this.registry = registry;
+    }
+
+    /**
+     */
+    public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
+                                                        RuntimeComponentReference reference,
+                                                        Binding binding) {
+        return new WireFormatJMSTextReferenceProvider(registry, component, reference, binding);
+    }
+
+    /**
+      */
+    public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
+                                                              RuntimeComponentService service,
+                                                              Binding binding) {
+        return new WireFormatJMSTextServiceProvider(registry, component, service, binding);
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
+     */
+    public Class getModelType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}



Mime
View raw message