tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r710080 [2/2] - in /tuscany/java/sca/modules: binding-jms-policy/ binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/ binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/context/ binding-jms-r...
Date Mon, 03 Nov 2008 15:11:50 GMT
Added: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java?rev=710080&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
(added)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
Mon Nov  3 07:11:49 2008
@@ -0,0 +1,142 @@
+/*
+ * 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.transport;
+
+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.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.security.auth.Subject;
+
+import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.provider.DefaultJMSBindingListener;
+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.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.policy.SecurityUtil;
+import org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal;
+import org.apache.tuscany.sca.runtime.EndpointReference;
+import org.apache.tuscany.sca.runtime.ReferenceParameters;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+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 TransportServiceInterceptor implements Interceptor {
+    private static final Logger logger = Logger.getLogger(TransportServiceInterceptor.class.getName());
+      
+    private Invoker next;
+    private RuntimeWire runtimeWire;
+    private JMSResourceFactory jmsResourceFactory;
+    private JMSBinding jmsBinding;
+    private JMSMessageProcessor requestMessageProcessor;
+    private JMSMessageProcessor responseMessageProcessor;
+    private RuntimeComponentService service;
+    
+
+    public TransportServiceInterceptor(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.service = (RuntimeComponentService)runtimeWire.getTarget().getContract();
+    }
+    
+    public Message invoke(Message msg) {
+        return invokeResponse(next.invoke(invokeRequest(msg)));
+    }    
+    
+    public Message invokeRequest(Message msg) { 
+        try {
+            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+            javax.jms.Message requestJMSMsg = context.getJmsMsg();
+            
+            EndpointReference from = new EndpointReferenceImpl(null);
+            msg.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);
+            }
+            
+            return msg;
+        } catch (JMSException e) {
+            throw new JMSBindingException(e);
+        }
+    }
+    
+    public Message invokeResponse(Message msg) { 
+        try {
+            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+            Session session = context.getJmsSession();
+            javax.jms.Message requestJMSMsg = context.getJmsMsg();
+
+            if (requestJMSMsg.getJMSReplyTo() == null) {
+                // assume no reply is expected
+                if (msg.getBody() != null) {
+                    logger.log(Level.FINE, "JMS service '" + service.getName() + "' dropped
response as request has no replyTo");
+                }
+                return msg;
+            }
+                       
+            MessageProducer producer = session.createProducer(context.getReplyToDestination());
+    
+            producer.send((javax.jms.Message)msg.getBody());
+    
+            producer.close();
+            session.close();
+            
+            return msg;
+    
+        } catch (JMSException 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/transport/TransportServiceInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProviderFactory.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/WireFormatJMSDefaultProviderFactory.java?rev=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProviderFactory.java
(original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultProviderFactory.java
Mon Nov  3 07:11:49 2008
@@ -41,7 +41,6 @@
         super();
         this.registry = registry;
         jmsRFEP = (JMSResourceFactoryExtensionPoint)registry.getExtensionPoint(JMSResourceFactoryExtensionPoint.class);
-
     }
 
     /**

Modified: 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=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java
(original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultReferenceInterceptor.java
Mon Nov  3 07:11:49 2008
@@ -21,14 +21,30 @@
 
 
 
+import java.util.Map;
+
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Session;
+
+import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
 import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.provider.JMSBindingServiceBindingProvider;
 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.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 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.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.apache.tuscany.sca.runtime.RuntimeWire;
 
 /**
@@ -73,20 +89,40 @@
         msg = getNext().invoke(msg);
         
         if (responseWireFormat != null){
-            msg = invokeRequest(msg);
+            msg = invokeResponse(msg);
         }
         
         return msg;
     }
     
     public Message invokeRequest(Message msg) {
-        // TODO binding interceptor iface TBD
-        return null;
+        try {
+            // get the jms context
+            JMSBindingContext context = (JMSBindingContext)msg.getHeaders().get(JMSBindingConstants.MSG_CTXT_POSITION);
+            Session session = context.getJmsSession();
+            
+            javax.jms.Message requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session,
msg.getBody());
+            msg.setBody(requestMsg);
+            
+            requestMsg.setJMSReplyTo(context.getReplyToDestination());
+            
+            return msg;
+        } catch (JMSException e) {
+            throw new JMSBindingException(e);
+        } 
     }
     
     public Message invokeResponse(Message msg) {
-        // TODO binding interceptor iface TBD
-        return null;
+        if (msg.getBody() != null){
+            Object[] response = (Object[])responseMessageProcessor.extractPayloadFromJMSMessage((javax.jms.Message)msg.getBody());
+            if (response != null && response.length > 0){
+                msg.setBody(response[0]);
+            } else {
+                msg.setBody(null);
+            }
+        }
+
+        return msg;
     }    
 
     public Invoker getNext() {
@@ -95,5 +131,5 @@
 
     public void setNext(Invoker next) {
         this.next = next;
-    }
+    }    
 }

Modified: 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=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java
(original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/WireFormatJMSDefaultServiceInterceptor.java
Mon Nov  3 07:11:49 2008
@@ -122,7 +122,7 @@
             } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme))
{
                 responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
             }    
-            
+        
             msg.setBody(responseJMSMsg);
             
             return msg;

Modified: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java?rev=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java
(original)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java
Mon Nov  3 07:11:49 2008
@@ -37,15 +37,15 @@
     // reference binding invoker
     String REFERENCE_BINDING = "reference.binding";
 
-    String REFERENCE_BINDING_DISPATCHER = "reference.binding.dispatcher";
     String REFERENCE_BINDING_WIREFORMAT = "reference.binding.wireformat";
     String REFERENCE_BINDING_POLICY = "reference.binding.policy";
     String REFERENCE_BINDING_TRANSPORT = "reference.binding.transport";
 
     String SERVICE_BINDING_TRANSPORT = "service.binding.transport";
+    String SERVICE_BINDING_OPERATION_SELECTOR = "service.binding.operationselector";
     String SERVICE_BINDING_WIREFORMAT = "service.binding.wireformat";
     String SERVICE_BINDING_POLICY = "service.binding.policy";
-    String SERVICE_BINDING_OPERATION_SELECTOR = "service.binding.operationselector";
+    
     
     // The first phase for incoming invocations via a service
     String SERVICE_BINDING = "service.binding";

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java?rev=710080&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java
(added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java
Mon Nov  3 07:11:49 2008
@@ -0,0 +1,38 @@
+/*
+ * 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.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+
+/**
+ * TODO RRB experiment
+ * This is an experiment extension to try out the request response
+ * binding function
+ * @version $Rev$ $Date$
+ */
+public interface PolicyProviderRRB extends PolicyProvider {
+    /**
+     * Create a binding interceptor 
+     * @return An interceptor that realize the policySet
+     */
+    Interceptor createBindingInterceptor();
+
+}

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

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

Added: tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java?rev=710080&view=auto
==============================================================================
--- tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java
(added)
+++ tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java
Mon Nov  3 07:11:49 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.runtime.RuntimeWire;
+
+/**
+ * TODO RRB experiment
+ * This is an experiment extension to try out the request response
+ * binding function
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ReferenceBindingProviderRRB extends ReferenceBindingProvider {
+    
+    void configureBindingChain(RuntimeWire runtimeWire);
+
+}

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

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

Modified: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java?rev=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
Mon Nov  3 07:11:49 2008
@@ -41,9 +41,13 @@
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.invocation.MessageFactory;
 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.provider.ImplementationProvider;
 import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.PolicyProviderRRB;
 import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ReferenceBindingProviderRRB;
 import org.apache.tuscany.sca.provider.ServiceBindingProvider;
 import org.apache.tuscany.sca.provider.ServiceBindingProviderRRB;
 import org.apache.tuscany.sca.runtime.EndpointReference;
@@ -118,6 +122,7 @@
             Contract source = wireSource.getContract();
             if (source instanceof RuntimeComponentReference) {
                 bindingInvocationChain = new InvocationChainImpl(null, null, true);
+                initReferenceBindingInvocationChains();
             } else {
                 bindingInvocationChain = new InvocationChainImpl(null, null, false);
                 initServiceBindingInvocationChains();
@@ -210,6 +215,38 @@
         wireProcessor.process(this);
     }
     
+    private void initReferenceBindingInvocationChains() {
+        RuntimeComponentReference reference = (RuntimeComponentReference)wireSource.getContract();
+        Binding referenceBinding = wireSource.getBinding();
+        
+        // add the binding interceptors to the reference binding wire
+        ReferenceBindingProvider provider = reference.getBindingProvider(referenceBinding);
+        if ((provider != null) &&
+            (provider instanceof ReferenceBindingProviderRRB)){
+            ((ReferenceBindingProviderRRB)provider).configureBindingChain(this);
+        }
+        
+        // add the policy interceptors to the service binding wire
+        // find out which policies are active
+        List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(referenceBinding);
+        if (pps != null) {
+            for (PolicyProvider p : pps) {
+                if (p instanceof PolicyProviderRRB) {
+                    Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor();
+                    if (interceptor != null) {
+                        bindingInvocationChain.addInterceptor(p.getPhase(), interceptor);
+                    }
+                }
+            }
+        }        
+        
+        // TODO - add something on the end of the wire to invoke the 
+        //        invocation chain. Need to split out the runtime
+        //        wire invoker into conversation, callback interceptors etc
+       
+        
+    }    
+    
     private void initServiceBindingInvocationChains() {
         RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
         Binding serviceBinding = wireTarget.getBinding();
@@ -222,6 +259,17 @@
         }
         
         // add the policy interceptors to the service binding wire
+        List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(serviceBinding);
+        if (pps != null) {
+            for (PolicyProvider p : pps) {
+                if (p instanceof PolicyProviderRRB) {
+                    Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor();
+                    if (interceptor != null) {
+                        bindingInvocationChain.addInterceptor(p.getPhase(), interceptor);
+                    }
+                }
+            }
+        }        
         
         
         // TODO - add something on the end of the wire to invoke the 

Modified: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/PhaseManager.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/PhaseManager.java?rev=710080&r1=710079&r2=710080&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/PhaseManager.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/PhaseManager.java
Mon Nov  3 07:11:49 2008
@@ -23,7 +23,6 @@
 import static org.apache.tuscany.sca.invocation.Phase.IMPLEMENTATION_POLICY;
 import static org.apache.tuscany.sca.invocation.Phase.REFERENCE;
 import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_DISPATCHER;
 import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_POLICY;
 import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_TRANSPORT;
 import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_WIREFORMAT;
@@ -70,10 +69,10 @@
         {REFERENCE, REFERENCE_INTERFACE, REFERENCE_POLICY, REFERENCE_BINDING};
 
     private static final String[] SYSTEM_REFERENCE_BINDING_PHASES =
-    {REFERENCE_BINDING_DISPATCHER, REFERENCE_BINDING_WIREFORMAT, REFERENCE_BINDING_POLICY,
REFERENCE_BINDING_TRANSPORT};
+    {REFERENCE_BINDING_WIREFORMAT, REFERENCE_BINDING_POLICY, REFERENCE_BINDING_TRANSPORT};
 
     private static final String[] SYSTEM_SERVICE_BINDING_PHASES =
-    {SERVICE_BINDING_TRANSPORT, SERVICE_BINDING_WIREFORMAT, SERVICE_BINDING_POLICY, SERVICE_BINDING_OPERATION_SELECTOR};
+    {SERVICE_BINDING_TRANSPORT, SERVICE_BINDING_OPERATION_SELECTOR, SERVICE_BINDING_WIREFORMAT,
SERVICE_BINDING_POLICY};
     
     private static final String[] SYSTEM_SERVICE_PHASES =
         {SERVICE_BINDING, SERVICE_POLICY, SERVICE_INTERFACE, SERVICE};



Mime
View raw message