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 2009/04/24 21:32:01 UTC

svn commit: r768402 - in /tuscany/branches/sca-java-1.x: itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/ modules/binding-jms-runtime/src/main/java/org/apa...

Author: slaws
Date: Fri Apr 24 19:32:00 2009
New Revision: 768402

URL: http://svn.apache.org/viewvc?rev=768402&view=rev
Log:
TUSCANY-2987 code to make nativeOperation based operation selection work and add new operation selector (jmsUser) that allows you to specify what JMS message property holds the operation name. No test cases yet. 

Added:
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/
    tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java   (with props)
Modified:
    tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java

Modified: tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java?rev=768402&r1=768401&r2=768402&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java Fri Apr 24 19:32:00 2009
@@ -80,7 +80,8 @@
         // assertEquals(3, MsgServiceImpl.msg.getJMSPriority()); // Doesn't seem to work with ActiveMQ
         assertEquals("myHeadP1", MsgServiceImpl.msg.getStringProperty("headP1"));
         assertEquals("foo", MsgServiceImpl.msg.getStringProperty("op2P2"));
-        assertEquals("nativeOp2", MsgServiceImpl.msg.getStringProperty("scaOperationName"));
+        //operation properties are a service side thing
+        //assertEquals("nativeOp2", MsgServiceImpl.msg.getStringProperty("scaOperationName"));
     }
 
     @After

Modified: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java?rev=768402&r1=768401&r2=768402&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java Fri Apr 24 19:32:00 2009
@@ -90,7 +90,9 @@
             String operationName = operation.getName();
             RuntimeComponentReference reference = (RuntimeComponentReference)runtimeWire.getSource().getContract();
             
-            requestMessageProcessor.setOperationName(jmsBinding.getNativeOperationName(operationName), jmsMsg);
+            // I think the OASIS spec suggests we do not need to do anything with
+            // @nativeOperation here on the reference side.
+            requestMessageProcessor.setOperationName(operationName, jmsMsg);
     
             if (jmsBinding.getOperationJMSDeliveryMode(operationName) != null) {
                 if (jmsBinding.getOperationJMSDeliveryMode(operationName)) {

Added: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java Fri Apr 24 19:32:00 2009
@@ -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.operationselector.userprop.runtime;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.operationselector.userprop.OperationSelectorJMSUserProp;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.OperationSelectorProvider;
+import org.apache.tuscany.sca.provider.OperationSelectorProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class OperationSelectorJMSUserPropProviderFactory implements OperationSelectorProviderFactory<OperationSelectorJMSUserProp> {
+    private ExtensionPointRegistry registry;
+    
+    public OperationSelectorJMSUserPropProviderFactory(ExtensionPointRegistry registry) {
+        super();
+        this.registry = registry;
+    }
+    
+    /**
+     */
+    public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component,
+                                                        RuntimeComponentReference reference,
+                                                        Binding binding) {
+        return null;
+    }
+
+    /**
+      */
+    public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component,
+                                                              RuntimeComponentService service,
+                                                              Binding binding) {
+        return new OperationSelectorJMSUserPropServiceProvider(component, service, binding);
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
+     */
+    public Class getModelType() {
+        return null;
+    }
+
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropProviderFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java Fri Apr 24 19:32:00 2009
@@ -0,0 +1,103 @@
+/*
+ * 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.operationselector.userprop.runtime;
+
+import java.util.List;
+
+import javax.jms.JMSException;
+
+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.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.operationselector.userprop.OperationSelectorJMSUserProp;
+import org.apache.tuscany.sca.interfacedef.Operation;
+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.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+  * Interceptor for user property based operation selection
+ * 
+ * <operationSelector.jmsUser propertName="MyHeaderProperty"/>
+ * 
+ */
+public class OperationSelectorJMSUserPropServiceInterceptor implements Interceptor {
+
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSBinding jmsBinding;
+    private OperationSelectorJMSUserProp operationSelector;
+    private RuntimeComponentService service;
+    private List<Operation> serviceOperations;
+
+    public OperationSelectorJMSUserPropServiceInterceptor(JMSBinding jmsBinding, RuntimeWire runtimeWire) {
+        super();
+        this.jmsBinding = jmsBinding;
+        this.operationSelector = (OperationSelectorJMSUserProp)jmsBinding.getOperationSelector();
+        this.runtimeWire = runtimeWire;
+        this.service = (RuntimeComponentService) runtimeWire.getTarget().getContract();
+        this.serviceOperations = service.getInterfaceContract().getInterface().getOperations();
+    }
+
+    public Message invoke(Message msg) {
+        return next.invoke(invokeRequest(msg));
+    }
+
+    public Message invokeRequest(Message msg) {
+            // get the jms context
+            JMSBindingContext context = msg.getBindingContext();
+            javax.jms.Message jmsMsg = context.getJmsMsg();
+           
+            Operation operation = getTargetOperation(jmsMsg);
+            msg.setOperation(operation);
+
+            return msg;
+    }
+
+    protected Operation getTargetOperation(javax.jms.Message jmsMsg) {
+        String operationName = null;
+        String opSelectorPropertyName =operationSelector.getPropertyName();
+        
+        try {
+            operationName = jmsMsg.getStringProperty(opSelectorPropertyName);
+        } catch(JMSException e) {
+            throw new JMSBindingException(e);
+        }
+        
+        for (Operation op : serviceOperations) {
+            if (op.getName().equals(operationName)) {
+                return op;
+            }
+        }
+        
+        throw new JMSBindingException("Can't find operation " + operationName);
+    }
+
+
+    public Invoker getNext() {
+        return next;
+    }
+
+    public void setNext(Invoker next) {
+        this.next = next;
+    }
+
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java Fri Apr 24 19:32:00 2009
@@ -0,0 +1,54 @@
+/*
+ * 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.operationselector.userprop.runtime;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.provider.OperationSelectorProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class OperationSelectorJMSUserPropServiceProvider implements OperationSelectorProvider {
+    private RuntimeComponent component;
+    private RuntimeComponentService service;
+    private Binding binding;
+
+    public OperationSelectorJMSUserPropServiceProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
+        super();
+        this.component = component;
+        this.service = service;
+        this.binding = binding;
+    }
+
+    /**
+     */
+    public Interceptor createInterceptor() {
+        return new OperationSelectorJMSUserPropServiceInterceptor((JMSBinding)binding, service.getRuntimeWire(binding));
+    }
+
+    /**
+     */
+    public String getPhase() {
+        return Phase.SERVICE_BINDING_OPERATION_SELECTOR;
+    }
+
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/runtime/OperationSelectorJMSUserPropServiceProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java?rev=768402&r1=768401&r2=768402&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java Fri Apr 24 19:32:00 2009
@@ -181,7 +181,11 @@
         // add operation selector interceptor
         bindingChain.addInterceptor(operationSelectorProvider.getPhase(), 
                                     operationSelectorProvider.createInterceptor());
-        
+
+        // add operationProperties interceptor after operation selector
+        bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR,
+                                    new OperationPropertiesInterceptor(jmsBinding, runtimeWire));
+
         // add callback destination interceptor after operation selector
         bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT,
                                     new CallbackDestinationInterceptor(runtimeWire));

Added: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java Fri Apr 24 19:32:00 2009
@@ -0,0 +1,78 @@
+/*
+ * 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.wire;
+
+import java.util.List;
+
+import javax.jms.Destination;
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+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.core.assembly.EndpointReferenceImpl;
+import org.apache.tuscany.sca.interfacedef.Operation;
+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.ReferenceParameters;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+public class OperationPropertiesInterceptor implements Interceptor {
+    private Invoker next;
+    private JMSBinding jmsBinding;
+    private RuntimeComponentService service;
+    private List<Operation> serviceOperations;
+          
+    public OperationPropertiesInterceptor(JMSBinding jmsBinding, RuntimeWire runtimeWire) {
+        super();
+        this.jmsBinding = jmsBinding;
+        this.service = (RuntimeComponentService) runtimeWire.getTarget().getContract();
+        this.serviceOperations = service.getInterfaceContract().getInterface().getOperations();
+    }
+
+    public Invoker getNext() {
+        return next;
+    }
+
+    public void setNext(Invoker next) {
+        this.next = next;
+    }
+
+    public Message invoke(Message msg) {
+        return next.invoke(invokeRequest(msg));
+    }
+
+    public Message invokeRequest(Message msg) {           
+        //  TODO - could probably optimize this better 
+        String operationName = msg.getOperation().getName();
+        String operationNameOverride = jmsBinding.getNativeOperationName(operationName);
+        for (Operation op : serviceOperations) {
+            if (op.getName().equals(operationNameOverride)) {
+                msg.setOperation(op);
+                break;
+            }
+        }
+        return msg;
+    }
+
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/OperationPropertiesInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java Fri Apr 24 19:32:00 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.operationselector.userprop;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.OperationSelector;
+
+/**
+ * Model of user property based operation selection
+ * 
+ * <operationSelector.jmsUser propertName="MyHeaderProperty"/>
+ *
+ * @version $Rev$ $Date$
+ */
+public class OperationSelectorJMSUserProp implements OperationSelector {
+    public static final QName OPERATION_SELECTOR_JMS_USERPROP_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "operationSelector.jmsUser");
+    public static final String OPERATION_SELECTOR_JMS_USERPROP_ATTR  = "propertyName";
+    
+    private String propertyName;
+    
+    public QName getSchemaName() {
+        return OPERATION_SELECTOR_JMS_USERPROP_QNAME;
+    }
+
+    public boolean isUnresolved() {
+        return false;
+    }
+
+    public void setUnresolved(boolean unresolved) {
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public void setPropertyName(String propertyName) {
+        this.propertyName = propertyName;
+    }
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserProp.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java?rev=768402&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java Fri Apr 24 19:32:00 2009
@@ -0,0 +1,81 @@
+/*
+ * 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.operationselector.userprop;
+
+
+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.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 OperationSelectorJMSUserPropProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<OperationSelectorJMSUserProp> {
+    
+    public QName getArtifactType() {
+        return OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_QNAME;
+    }
+    
+    public OperationSelectorJMSUserPropProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    }
+
+    
+    public OperationSelectorJMSUserProp read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        OperationSelectorJMSUserProp opSelector = new OperationSelectorJMSUserProp();
+        String propertyName = reader.getAttributeValue(null, OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_ATTR);
+        opSelector.setPropertyName(propertyName);
+        return opSelector;
+    }
+
+    public void write(OperationSelectorJMSUserProp opSelector, XMLStreamWriter writer) 
+        throws ContributionWriteException, XMLStreamException {
+        String prefix = "tuscany";
+        writer.writeStartElement(prefix, 
+                                 getArtifactType().getLocalPart(),
+                                 getArtifactType().getNamespaceURI());
+        writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); 
+        
+        if (opSelector.getPropertyName() != null) {
+            writer.writeAttribute(OperationSelectorJMSUserProp.OPERATION_SELECTOR_JMS_USERPROP_ATTR, opSelector.getPropertyName());
+        }
+        
+        writer.writeEndElement();
+    }
+
+    public Class<OperationSelectorJMSUserProp> getModelType() {
+        return OperationSelectorJMSUserProp.class;
+    }
+
+    public void resolve(OperationSelectorJMSUserProp arg0, ModelResolver arg1) throws ContributionResolveException {
+
+    }
+    
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/userprop/OperationSelectorJMSUserPropProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date