You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2008/10/21 15:22:47 UTC

svn commit: r706620 [2/3] - in /tuscany/java/sca: itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/ itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/ itest/jms-format/src/main...

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=706620&r1=706619&r2=706620&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 Tue Oct 21 06:22:46 2008
@@ -19,6 +19,7 @@
 
 package org.apache.tuscany.sca.binding.jms.provider;
 
+import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -26,6 +27,7 @@
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.Topic;
@@ -36,14 +38,21 @@
 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.operationselector.jmsdefault.OperationSelectorJMSDefaultReferenceInterceptor;
+import org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefaultServiceInterceptor;
+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.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.invocation.Invoker;
 import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProviderRRB;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
 import org.apache.tuscany.sca.work.WorkScheduler;
 
 /**
@@ -51,7 +60,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class JMSBindingServiceBindingProvider implements ServiceBindingProvider {
+public class JMSBindingServiceBindingProvider implements ServiceBindingProviderRRB {
     private static final Logger logger = Logger.getLogger(JMSBindingServiceBindingProvider.class.getName());
 
     private RuntimeComponentService service;
@@ -179,7 +188,20 @@
             consumer = session.createConsumer(destination);
         }
 
-        final DefaultJMSBindingListener listener = new DefaultJMSBindingListener(jmsBinding, jmsResourceFactory, service, targetBinding);
+        MessageListener tmpListener = null;
+        
+        /*
+         * TODO a test to allow RRB experiments to take place without breaking everything else
+         *      RRB stuff only happens if you add a wireFormat to a composite file
+         */
+        if (jmsBinding.getWireFormat() != null ){
+            tmpListener = new RRBJMSBindingListener(jmsBinding, jmsResourceFactory, service, targetBinding);
+        } else {
+            tmpListener = new DefaultJMSBindingListener(jmsBinding, jmsResourceFactory, service, targetBinding);
+        }
+        
+        final MessageListener listener = tmpListener;
+        
         try {
 
             consumer.setMessageListener(listener);
@@ -303,4 +325,21 @@
             throw new JMSBindingException(e);
         }
     }
+    
+    /*
+     * RRB test methods
+     * Interceptor selection is hard coded to the default here but of course should
+     * pick up the appropriate interceptor based on wireFormat and operationSelector 
+     * elements in the SCDL
+     */
+    public void configureServiceBindingRequestChain(List<Invoker> bindingRequestChain, RuntimeWire runtimeWire) {
+
+        bindingRequestChain.add(new OperationSelectorJMSDefaultServiceInterceptor(jmsBinding, jmsResourceFactory, runtimeWire));
+        bindingRequestChain.add(new WireFormatJMSDefaultServiceInterceptor(jmsBinding, jmsResourceFactory, runtimeWire));
+    }
+    
+    public void configureServiceBindingResponseChain(List<Invoker> bindingResponseChain, RuntimeWire runtimeWire) {
+        bindingResponseChain.add(new WireFormatJMSDefaultServiceInterceptor(jmsBinding, jmsResourceFactory, runtimeWire));
+        bindingResponseChain.add(new OperationSelectorJMSDefaultServiceInterceptor(jmsBinding, jmsResourceFactory, runtimeWire));  
+    }
 }

Added: 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=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingListener.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,276 @@
+/*
+ * 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.provider;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+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.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.impl.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicy;
+import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl;
+import org.apache.tuscany.sca.core.invocation.MessageImpl;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.BindingInterceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.SecurityUtil;
+import org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal;
+import org.apache.tuscany.sca.provider.ServiceBindingProviderRRB;
+import org.apache.tuscany.sca.runtime.EndpointReference;
+import org.apache.tuscany.sca.runtime.ReferenceParameters;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * TODO RRB experiement
+ * Listener for the JMSBinding.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class RRBJMSBindingListener implements MessageListener {
+
+    private static final Logger logger = Logger.getLogger(RRBJMSBindingListener.class.getName());
+
+    private static final String ON_MESSAGE_METHOD_NAME = "onMessage";
+    private JMSBinding jmsBinding;
+    private Binding targetBinding;
+    private JMSResourceFactory jmsResourceFactory;
+    private RuntimeComponentService service;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+    private String correlationScheme;
+    private List<Operation> serviceOperations;
+    protected JMSTokenAuthenticationPolicy jmsTokenAuthenticationPolicy = null;
+    
+    /*
+     * TODO binding chains could be treated generically (RuntimeWire?) but are
+     *      here just now for experimental convenience
+     */
+    private List<Invoker> bindingRequestChain;
+    private List<Invoker> bindingResponseChain;
+
+    public RRBJMSBindingListener(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeComponentService service, Binding targetBinding) throws NamingException {
+        this.jmsBinding = jmsBinding;
+        this.jmsResourceFactory = jmsResourceFactory;
+        this.service = service;
+        this.targetBinding = targetBinding;
+        requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(jmsBinding);
+        responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(jmsBinding);
+        correlationScheme = jmsBinding.getCorrelationScheme();
+        serviceOperations = service.getInterfaceContract().getInterface().getOperations();
+        
+        // find out which policies are active
+        if (jmsBinding instanceof PolicySetAttachPoint) {
+            List<PolicySet> policySets = ((PolicySetAttachPoint)jmsBinding).getApplicablePolicySets();
+            for (PolicySet ps : policySets) {
+                for (Object p : ps.getPolicies()) {
+                    if (JMSTokenAuthenticationPolicy.class.isInstance(p)) {
+                        jmsTokenAuthenticationPolicy = (JMSTokenAuthenticationPolicy)p;
+                    }else {
+                        // etc. check for other types of policy being present
+                    }
+                }
+            }
+        } 
+        
+        // Set up request/response chains for RRB
+        bindingRequestChain = new ArrayList<Invoker>();
+        bindingResponseChain = new ArrayList<Invoker>();
+        
+        ServiceBindingProviderRRB provider = (ServiceBindingProviderRRB)service.getBindingProvider(jmsBinding);
+        provider.configureServiceBindingRequestChain(bindingRequestChain, service.getRuntimeWire(targetBinding));
+        provider.configureServiceBindingResponseChain(bindingResponseChain, service.getRuntimeWire(targetBinding));
+
+    }
+
+    public void onMessage(Message requestJMSMsg) {
+        logger.log(Level.FINE, "JMS service '" + service.getName() + "' received message " + requestJMSMsg);
+        try {
+            invokeService(requestJMSMsg);
+            //sendReply(requestJMSMsg, responsePayload, false);
+        } catch (Throwable e) {
+            logger.log(Level.SEVERE, "Exception invoking service '" + service.getName(), e);
+            sendReply(requestJMSMsg, e, true);
+        }
+    }
+
+    /**
+     * TODO RRB Experiment. Explicity call all the binding interceptors on the wire. Looking at
+     *      how to handle requests and responses independently. The binding wire should/could
+     *      be handled generically outside of this binding class but it's here for the momement
+     *      while we look at what form it takes
+     *      
+     * Turn the JMS message back into a Tuscany message and invoke the target component
+     * 
+     * @param requestJMSMsg
+     * @return
+     * @throws JMSException
+     * @throws InvocationTargetException
+     */
+    protected void invokeService(Message requestJMSMsg) throws JMSException, InvocationTargetException {
+
+        // create the tuscany message
+        MessageImpl tuscanyMsg = new MessageImpl();
+        
+        // populate the message context with JMS binding information
+        tuscanyMsg.getHeaders().add(requestJMSMsg);
+        
+        // call the request wire
+        for (Invoker invoker : bindingRequestChain){
+           ((BindingInterceptor)invoker).invokeRequest(tuscanyMsg);
+        }
+        
+        // call the runtime wire
+        setHeaderProperties(requestJMSMsg, tuscanyMsg, tuscanyMsg.getOperation());
+        Object response = service.getRuntimeWire(targetBinding).invoke(tuscanyMsg.getOperation(), tuscanyMsg);
+        
+        tuscanyMsg.setBody(response);
+        
+        if (requestJMSMsg.getJMSReplyTo() == null) {
+            // assume no reply is expected
+            if (response != null) {
+                logger.log(Level.FINE, "JMS service '" + service.getName() + "' dropped response as request has no replyTo");
+            }
+            return;
+        }
+        
+        // call the response wire
+        for (Invoker invoker : bindingResponseChain){
+            ((BindingInterceptor)invoker).invokeResponse(tuscanyMsg);
+        }
+    }
+
+    /**
+     * TODO - RRB experiment. Needs refactoring
+     */
+    protected void setHeaderProperties(javax.jms.Message requestJMSMsg, MessageImpl tuscanyMsg, Operation operation) throws JMSException {
+
+        EndpointReference from = new EndpointReferenceImpl(null);
+        tuscanyMsg.setFrom(from);
+        from.setCallbackEndpoint(new EndpointReferenceImpl("/")); // TODO: whats this for?
+        ReferenceParameters parameters = from.getReferenceParameters();
+
+        String conversationID = requestJMSMsg.getStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY);
+        if (conversationID != null) {
+            parameters.setConversationID(conversationID);
+        }
+
+        if (service.getInterfaceContract().getCallbackInterface() != null) {
+
+            String callbackdestName = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
+            if (callbackdestName == null && operation.isNonBlocking()) {
+                // if the request has a replyTo but this service operation is oneway but the service uses callbacks
+                // then use the replyTo as the callback destination
+                Destination replyTo = requestJMSMsg.getJMSReplyTo();
+                if (replyTo != null) {
+                    callbackdestName = (replyTo instanceof Queue) ? ((Queue)replyTo).getQueueName() : ((Topic)replyTo).getTopicName();
+                }
+            }
+
+            if (callbackdestName != null) {
+                // append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
+                // as otherwise the invoker should use the uri from the service callback binding
+                parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
+            }
+
+            String callbackID = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
+            if (callbackID != null) {
+                parameters.setCallbackID(callbackID);
+            }
+        }
+        
+       
+        if (jmsTokenAuthenticationPolicy != null) {
+            String token = requestJMSMsg.getStringProperty(jmsTokenAuthenticationPolicy.getTokenName().toString());
+            
+            Subject subject = SecurityUtil.getSubject(tuscanyMsg);
+            TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
+            
+            if (principal == null){
+                principal = new TokenPrincipal(token);
+                subject.getPrincipals().add(principal);
+            }
+
+        }
+    }    
+
+    /*
+     * TODO RRB experiment. Still used to handle errors. Needs refactoring
+     */
+    protected void sendReply(Message requestJMSMsg, Object responsePayload, boolean isFault) {
+        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;
+            if (isFault) {
+                replyJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)responsePayload);
+            } else {
+                replyJMSMsg = responseMessageProcessor.insertPayloadIntoJMSMessage(session, 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);
+        }
+    }
+
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytes.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytes.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytes.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytes.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.bytes;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.WireFormat;
+
+/**
+ * Implementation for policies that could be injected as parameter
+ * into the axis2config.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSBytes implements WireFormat {
+    public static final QName WIRE_FORMAT_JMS_BYTE_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "wireFormat.JMSBytes");
+    
+    public QName getSchemaName() {
+        return WIRE_FORMAT_JMS_BYTE_QNAME;
+    }
+
+    public boolean isUnresolved() {
+        return false;
+    }
+
+    public void setUnresolved(boolean unresolved) {
+    }
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProcessor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProcessor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProcessor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,79 @@
+/*
+ * 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.bytes;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.jms.policy.header.JMSHeaderPolicy;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSBytesProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WireFormatJMSBytes> {
+    
+    public QName getArtifactType() {
+        return WireFormatJMSBytes.WIRE_FORMAT_JMS_BYTE_QNAME;
+    }
+    
+    public WireFormatJMSBytesProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    }
+
+    
+    public WireFormatJMSBytes read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        WireFormatJMSBytes wireFormat = new WireFormatJMSBytes();
+         
+        return wireFormat;
+    }
+
+    public void write(WireFormatJMSBytes wireFormat, XMLStreamWriter writer) 
+        throws ContributionWriteException, XMLStreamException {
+        String prefix = "tuscany";
+        writer.writeStartElement(prefix, 
+                                 getArtifactType().getLocalPart(),
+                                 getArtifactType().getNamespaceURI());
+        writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); 
+        
+        writer.writeEndElement();
+    }
+
+    public Class<WireFormatJMSBytes> getModelType() {
+        return WireFormatJMSBytes.class;
+    }
+
+    public void resolve(WireFormatJMSBytes arg0, ModelResolver arg1) throws ContributionResolveException {
+
+    }
+    
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/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/bytes/WireFormatJMSBytesProviderFactory.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProviderFactory.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesProviderFactory.java Tue Oct 21 06:22:46 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.bytes;
+
+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 WireFormatJMSBytesProviderFactory implements WireFormatProviderFactory<WireFormatJMSBytes> {
+    private ExtensionPointRegistry registry;
+    
+    public WireFormatJMSBytesProviderFactory(ExtensionPointRegistry registry) {
+        super();
+        this.registry = registry;
+    }
+
+    /**
+     */
+    public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
+                                                        RuntimeComponentReference reference,
+                                                        Binding binding) {
+        return new WireFormatJMSBytesReferenceProvider(component, reference, binding);
+    }
+
+    /**
+      */
+    public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
+                                                              RuntimeComponentService service,
+                                                              Binding binding) {
+        return new WireFormatJMSBytesServiceProvider(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/bytes/WireFormatJMSBytesProviderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/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/bytes/WireFormatJMSBytesReferenceInterceptor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesReferenceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesReferenceInterceptor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,73 @@
+/*
+ * 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.bytes;
+
+
+import javax.jms.Session;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+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.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 WireFormatJMSBytesReferenceInterceptor implements Interceptor {
+
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+
+    public WireFormatJMSBytesReferenceInterceptor(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 (next != null){
+            return getNext().invoke(msg);
+        } else {
+            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/bytes/WireFormatJMSBytesReferenceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/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/bytes/WireFormatJMSBytesReferenceProvider.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesReferenceProvider.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesReferenceProvider.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,70 @@
+/*
+ * 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.bytes;
+
+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.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 WireFormatJMSBytesReferenceProvider implements WireFormatProvider {
+    private RuntimeComponent component;
+    private RuntimeComponentReference reference;
+    private Binding binding;
+
+    public WireFormatJMSBytesReferenceProvider(RuntimeComponent component,
+                                               RuntimeComponentReference reference,
+                                               Binding binding) {
+        super();
+        this.component = component;
+        this.reference = reference;
+        this.binding = binding;
+    }
+    
+    /**
+     * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
+     */
+    public Interceptor createInterceptor() {
+        return new WireFormatJMSBytesReferenceInterceptor((JMSBinding)binding, 
+                                                           null, 
+                                                           reference.getRuntimeWire(binding));
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
+     */
+    public String getPhase() {
+        return Phase.REFERENCE_POLICY;
+    }
+
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/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/bytes/WireFormatJMSBytesServiceInterceptor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesServiceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesServiceInterceptor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,77 @@
+/*
+ * 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.bytes;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+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.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 WireFormatJMSBytesServiceInterceptor implements Interceptor {
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+
+    public WireFormatJMSBytesServiceInterceptor(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) {
+        // get the jms message
+        javax.jms.Message jmsMsg = (javax.jms.Message)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_JMSREQUESTMSG_POSITION);
+        
+        msg.setBody(requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg));
+                
+        if (next != null){
+            return getNext().invoke(msg);
+        } else {
+            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/bytes/WireFormatJMSBytesServiceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/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/bytes/WireFormatJMSBytesServiceProvider.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesServiceProvider.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/bytes/WireFormatJMSBytesServiceProvider.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,66 @@
+/*
+ * 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.bytes;
+
+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.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 WireFormatJMSBytesServiceProvider implements WireFormatProvider {
+    private RuntimeComponent component;
+    private RuntimeComponentService service;
+    private Binding binding;
+
+    public WireFormatJMSBytesServiceProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
+        super();
+        this.component = component;
+        this.service = service;
+        this.binding = binding;
+    }
+
+    /**
+     */
+    public Interceptor createInterceptor() {
+        return new WireFormatJMSBytesServiceInterceptor((JMSBinding)binding,
+                                                         null,
+                                                        service.getRuntimeWire(binding));
+    }
+
+    /**
+     */
+    public String getPhase() {
+        return Phase.SERVICE_POLICY;
+    }
+
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefault.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefault.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefault.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefault.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.jmsdefault;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.WireFormat;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSDefault implements WireFormat {
+    public static final QName WIRE_FORMAT_JMS_DEFAULT_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "wireFormat.JMSDefault");
+    
+    public QName getSchemaName() {
+        return WIRE_FORMAT_JMS_DEFAULT_QNAME;
+    }
+
+    public boolean isUnresolved() {
+        return false;
+    }
+
+    public void setUnresolved(boolean unresolved) {
+    }
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProcessor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProcessor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProcessor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,79 @@
+/*
+ * 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.jmsdefault;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.jms.policy.header.JMSHeaderPolicy;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class WireFormatJMSDefaultProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WireFormatJMSDefault> {
+    
+    public QName getArtifactType() {
+        return WireFormatJMSDefault.WIRE_FORMAT_JMS_DEFAULT_QNAME;
+    }
+    
+    public WireFormatJMSDefaultProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    }
+
+    
+    public WireFormatJMSDefault read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        WireFormatJMSDefault wireFormat = new WireFormatJMSDefault();
+         
+        return wireFormat;
+    }
+
+    public void write(WireFormatJMSDefault wireFormat, XMLStreamWriter writer) 
+        throws ContributionWriteException, XMLStreamException {
+        String prefix = "tuscany";
+        writer.writeStartElement(prefix, 
+                                 getArtifactType().getLocalPart(),
+                                 getArtifactType().getNamespaceURI());
+        writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); 
+        
+        writer.writeEndElement();
+    }
+
+    public Class<WireFormatJMSDefault> getModelType() {
+        return WireFormatJMSDefault.class;
+    }
+
+    public void resolve(WireFormatJMSDefault arg0, ModelResolver arg1) throws ContributionResolveException {
+
+    }
+    
+}

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

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,85 @@
+/*
+ * 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.jmsdefault;
+
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+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.BindingInterceptor;
+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 WireFormatJMSDefaultReferenceInterceptor implements BindingInterceptor {
+
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+    private String correlationScheme;
+
+    public WireFormatJMSDefaultReferenceInterceptor(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);
+        this.correlationScheme = jmsBinding.getCorrelationScheme();
+    }
+
+    public Message invoke(Message msg) {
+        // TODO binding interceptor iface TBD
+        return null;
+    }
+    
+    public Message invokeRequest(Message msg) {
+        // TODO binding interceptor iface TBD
+        return null;
+    }
+    
+    public Message invokeResponse(Message msg) {
+        // TODO binding interceptor iface TBD
+        return null;
+    }    
+
+    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/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,131 @@
+/*
+ * 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.jmsdefault;
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+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.BindingInterceptor;
+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 WireFormatJMSDefaultServiceInterceptor implements BindingInterceptor {
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+    private String correlationScheme;
+
+    public WireFormatJMSDefaultServiceInterceptor(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);
+        this.correlationScheme = jmsBinding.getCorrelationScheme();
+    }
+    
+    public Message invoke(Message msg) {
+        // TODO binding interceptor iface TBD
+        return null;
+    }
+
+    public Message invokeRequest(Message msg) {
+        // get the jms message
+        javax.jms.Message jmsMsg = (javax.jms.Message)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_JMSREQUESTMSG_POSITION);
+        
+        if ("onMessage".equals(msg.getOperation().getName())) {
+            msg.setBody(new Object[]{jmsMsg});
+        } else {
+            Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg);
+            msg.setBody(requestPayload);
+        }
+                
+        if (next != null){
+            return getNext().invoke(msg);
+        } else {
+            return msg;
+        }
+    }
+    
+    public Message invokeResponse(Message msg) {
+        try {
+            // get the jms message
+            javax.jms.Message requestJMSMsg = (javax.jms.Message)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_JMSREQUESTMSG_POSITION);
+            
+            Session session = jmsResourceFactory.createSession();
+            msg.getHeaders().add(JMSBindingConstants.MSG_CTXT_JMSSESSION_POSITION, session);
+            
+            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());
+    
+            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);
+            
+            if (next != null){
+                return getNext().invoke(msg);
+            } else {
+                return msg;
+            }
+        } catch (JMSException e) {
+            throw new JMSBindingException(e);
+        } catch (NamingException e) {
+            throw new JMSBindingException(e);
+        }
+    }    
+
+    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/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor (added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor Tue Oct 21 06:22:46 2008
@@ -0,0 +1,20 @@
+# 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. 
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefaultProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#wireFormat.jmsDefault,model=org.apache.tuscany.sca.binding.jms.wireformat.jmsdefault.WireFormatJMSDefault
+org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefaultProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#operationSelector.jmsDefault,model=org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.OperationSelectorJMSDefault

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=706620&r1=706619&r2=706620&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 Tue Oct 21 06:22:46 2008
@@ -24,7 +24,9 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.BindingRRB;
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.IntentAttachPointType;
 import org.apache.tuscany.sca.policy.PolicySet;
@@ -36,7 +38,7 @@
  * @version $Rev$ $Date$
  */
 
-public class JMSBinding implements Binding, PolicySetAttachPoint {
+public class JMSBinding implements BindingRRB, PolicySetAttachPoint {
 
     @Override
     public Object clone() throws CloneNotSupportedException {
@@ -117,42 +119,26 @@
     private JMSBinding requestConnectionBinding;
     private JMSBinding responseConnectionBinding;
     
+    private WireFormat wireFormat;
+    private OperationSelector operationSelector;
+    
     public JMSBinding() {
         super();
     }
 
-    /**
-     * Returns the binding URI.
-     * 
-     * @return the binding URI
-     */
+    // operations required by Binding 
     public String getURI() {
         return this.uri;
     }
 
-    /**
-     * Sets the binding URI.
-     * 
-     * @param uri the binding URI
-     */
     public void setURI(String uri) {
         this.uri = uri;
     }
 
-    /**
-     * Returns the binding name.
-     * 
-     * @return the binding name
-     */
     public String getName() {
         return this.name;
     }
 
-    /**
-     * Sets the binding name.
-     * 
-     * @param name the binding name
-     */
     public void setName(String name) {
         this.name = name;
     }
@@ -168,6 +154,22 @@
     public List<Object> getExtensions() {
         return extensions;
     }
+    
+    public WireFormat getWireFormat() {
+        return wireFormat;
+    }
+    
+    public void setWireFormat(WireFormat wireFormat) {
+        this.wireFormat = wireFormat;
+    }
+    
+    public OperationSelector getOperationSelector() {
+        return operationSelector;
+    }
+    
+    public void setOperationSelector(OperationSelector operationSelector) {
+        this.operationSelector = operationSelector;
+    }
 
     // Methods for getting/setting JMS binding model information
     // as derived from the XML of the binding.jms element

Modified: tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java?rev=706620&r1=706619&r2=706620&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java (original)
+++ tuscany/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingConstants.java Tue Oct 21 06:22:46 2008
@@ -68,5 +68,8 @@
     String CALLBACK_ID_PROPERTY = "CallbackID";
     String CALLBACK_Q_PROPERTY = "scaCallbackQueue ";
     String CONVERSATION_ID_PROPERTY = "scaConversationId";
+    
+    int MSG_CTXT_JMSREQUESTMSG_POSITION = 0;
+    int MSG_CTXT_JMSSESSION_POSITION=1;
 
 }

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=706620&r1=706619&r2=706620&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 Tue Oct 21 06:22:46 2008
@@ -30,6 +30,9 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
 import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
@@ -41,6 +44,7 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.monitor.Problem;
 import org.apache.tuscany.sca.monitor.Problem.Severity;
@@ -118,11 +122,13 @@
 
     private PolicyFactory policyFactory;
     private PolicyAttachPointProcessor policyProcessor;
+    protected StAXArtifactProcessor<Object> extensionProcessor;
     private Monitor monitor;
 
-    public JMSBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    public JMSBindingProcessor(ModelFactoryExtensionPoint modelFactories, StAXArtifactProcessor<Object> extensionProcessor, Monitor monitor) {
         this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
         this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
+        this.extensionProcessor = extensionProcessor;
         this.monitor = monitor;
     }
     
@@ -249,6 +255,17 @@
                         parseOperationProperties(reader, jmsBinding);
                     } else if ("SubscriptionHeaders".equals(elementName)) {
                         parseSubscriptionHeaders(reader, jmsBinding);
+                    } else {
+                        Object extension = extensionProcessor.read(reader);
+                        if (extension != null) {
+                            if (extension instanceof WireFormat) {
+                                jmsBinding.setWireFormat((WireFormat)extension);
+                            } else if (extension instanceof OperationSelector) {
+                                jmsBinding.setOperationSelector((OperationSelector)extension);
+                            } else {
+                                error("UnexpectedElement", reader, extension.toString());
+                            }
+                        }
                     }
                     reader.next();
                     break;

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java (added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,46 @@
+/*
+ * 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.invocation;
+
+/**
+ * TODO RRB experiment to allow the request and respose side of the 
+ *      invoke to be called independently
+ * Synchronous mediation associated with a client- or target- side wire.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface BindingInterceptor extends Invoker {
+
+    /**
+     * Process a synchronous request
+     *
+     * @param msg The request Message for the wire
+     * @return The response Message from the wire
+     */
+    Message invokeRequest(Message msg);
+    
+    /**
+     * Process a synchronous response
+     *
+     * @param msg The request Message for the wire
+     * @return The response Message from the wire
+     */
+    Message invokeResponse(Message msg);    
+
+}

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/BindingInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java (added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,39 @@
+/*
+ * 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.provider;
+
+import org.apache.tuscany.sca.invocation.Interceptor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface OperationSelectorProvider {
+    /**
+     * Create an interceptor for the operation selector
+     * @return An interceptor that realize the policySet
+     */
+    Interceptor createInterceptor();
+
+    /**
+     * Get the phase that the interceptor should be added
+     * @return The phase that this interceptor belongs to
+     */
+    String getPhase();
+}

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java (added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,53 @@
+/*
+ * 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.provider;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.OperationSelector;
+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 interface OperationSelectortProviderFactory<M extends OperationSelector> extends ProviderFactory<M> {
+    /**
+     * Create wire format provider for a given reference binding
+     * @param component
+     * @param reference
+     * @param binding
+     * @return
+     */
+    PolicyProvider createReferenceOperationSelectorProvider(RuntimeComponent component,
+                                                            RuntimeComponentReference reference,
+                                                            Binding binding);
+
+    /**
+     * Create policy provider for a given service binding
+     * @param component
+     * @param service
+     * @param binding
+     * @return
+     */
+    PolicyProvider createServiceOperationSelectorProvider(RuntimeComponent component,
+                                                          RuntimeComponentService service,
+                                                          Binding binding);
+}

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectortProviderFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java (added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,40 @@
+/*
+ * 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.provider;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+ * TODO RRB experiment
+ * This is an experiment extension to try out the request response
+ * binding function
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ServiceBindingProviderRRB extends ServiceBindingProvider {
+    
+    void configureServiceBindingRequestChain(List<Invoker> bindingRequestChain, RuntimeWire runtimeWire);
+    void configureServiceBindingResponseChain(List<Invoker> bindingResponseChain, RuntimeWire runtimeWire);
+
+}

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java?rev=706620&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java (added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java Tue Oct 21 06:22:46 2008
@@ -0,0 +1,39 @@
+/*
+ * 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.provider;
+
+import org.apache.tuscany.sca.invocation.Interceptor;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WireFormatProvider {
+    /**
+     * Create an interceptor for the wire format
+     * @return An interceptor that realize the policySet
+     */
+    Interceptor createInterceptor();
+
+    /**
+     * Get the phase that the interceptor should be added
+     * @return The phase that this interceptor belongs to
+     */
+    String getPhase();
+}

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date