diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-01 11:35:46 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-01 11:35:46 +0000 |
commit | db033b2e2e8e0e652de49ef023c9e7735a7b927f (patch) | |
tree | da48c91751b69edd6d572a190ffae23e597bee96 /branches | |
parent | c4ede31b2bfdb610a32557353801f1844db70476 (diff) |
remove PolicyProviderRRB and detect RRB policies by looking at the phase.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@722040 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
5 files changed, 13 insertions, 68 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationReferencePolicyProvider.java b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationReferencePolicyProvider.java index a982e69ffd..b4fa617f74 100644 --- a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationReferencePolicyProvider.java +++ b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationReferencePolicyProvider.java @@ -29,14 +29,13 @@ 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.PolicyProviderRRB; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; /** * @version $Rev$ $Date$ */ -public class JMSTokenAuthenticationReferencePolicyProvider implements PolicyProviderRRB { +public class JMSTokenAuthenticationReferencePolicyProvider implements PolicyProvider { private RuntimeComponent component; private RuntimeComponentReference reference; private Binding binding; @@ -77,19 +76,16 @@ public class JMSTokenAuthenticationReferencePolicyProvider implements PolicyProv * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) */ public Interceptor createInterceptor(Operation operation) { - return null; - } - - public Interceptor createBindingInterceptor() { PolicySet ps = findPolicySet(); return ps == null ? null : new JMSTokenAuthenticationReferencePolicyInterceptor(getContext(), ps); - } + + } /** * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase() */ public String getPhase() { - return Phase.REFERENCE_POLICY; + return Phase.REFERENCE_BINDING_POLICY; } } diff --git a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationServicePolicyProvider.java b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationServicePolicyProvider.java index 209bd4becf..4b0944a420 100644 --- a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationServicePolicyProvider.java +++ b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/JMSTokenAuthenticationServicePolicyProvider.java @@ -29,14 +29,13 @@ 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.PolicyProviderRRB; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentService; /** * @version $Rev$ $Date$ */ -public class JMSTokenAuthenticationServicePolicyProvider implements PolicyProviderRRB { +public class JMSTokenAuthenticationServicePolicyProvider implements PolicyProvider { private RuntimeComponent component; private RuntimeComponentService service; private Binding binding; @@ -75,19 +74,15 @@ public class JMSTokenAuthenticationServicePolicyProvider implements PolicyProvid * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) */ public Interceptor createInterceptor(Operation operation) { - return null; - } - - public Interceptor createBindingInterceptor() { PolicySet ps = findPolicySet(); return ps == null ? null : new JMSTokenAuthenticationServicePolicyInterceptor(getContext(), ps); - } + } /** * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase() */ public String getPhase() { - return Phase.SERVICE_POLICY; + return Phase.SERVICE_BINDING_POLICY; } } diff --git a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderReferencePolicyProvider.java b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderReferencePolicyProvider.java index 7a9318407e..3983541de3 100644 --- a/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderReferencePolicyProvider.java +++ b/branches/sca-java-1.x/modules/binding-jms-policy/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderReferencePolicyProvider.java @@ -29,14 +29,13 @@ 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.PolicyProviderRRB; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; /** * @version $Rev$ $Date$ */ -public class JMSHeaderReferencePolicyProvider implements PolicyProviderRRB { +public class JMSHeaderReferencePolicyProvider implements PolicyProvider { private RuntimeComponent component; private RuntimeComponentReference reference; private Binding binding; @@ -77,14 +76,10 @@ public class JMSHeaderReferencePolicyProvider implements PolicyProviderRRB { * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) */ public Interceptor createInterceptor(Operation operation) { - return null; - } - - public Interceptor createBindingInterceptor() { PolicySet ps = findPolicySet(); return ps == null ? null : new JMSHeaderReferencePolicyInterceptor(getContext(), component, reference, binding, ps); } - + /** * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase() */ diff --git a/branches/sca-java-1.x/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java b/branches/sca-java-1.x/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java deleted file mode 100644 index fbe0dd5503..0000000000 --- a/branches/sca-java-1.x/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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(); - -} diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java index f03071ae88..ad38906e9d 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java @@ -41,11 +41,8 @@ import org.apache.tuscany.sca.invocation.Invoker; 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; @@ -235,8 +232,8 @@ public class RuntimeWireImpl implements RuntimeWire { List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(referenceBinding); if (pps != null) { for (PolicyProvider p : pps) { - if (p instanceof PolicyProviderRRB) { - Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor(); + if (p.getPhase().equals(Phase.REFERENCE_BINDING_POLICY)) { + Interceptor interceptor = p.createInterceptor(null); if (interceptor != null) { bindingInvocationChain.addInterceptor(Phase.REFERENCE_BINDING_POLICY, interceptor); } @@ -260,8 +257,8 @@ public class RuntimeWireImpl implements RuntimeWire { List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(serviceBinding); if (pps != null) { for (PolicyProvider p : pps) { - if (p instanceof PolicyProviderRRB) { - Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor(); + if (p.getPhase().equals(Phase.SERVICE_BINDING_POLICY)) { + Interceptor interceptor = p.createInterceptor(null); if (interceptor != null) { bindingInvocationChain.addInterceptor(Phase.SERVICE_BINDING_POLICY, interceptor); } |