diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java')
3 files changed, 11 insertions, 87 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationReferencePolicyProvider.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationReferencePolicyProvider.java index e630d0cd53..97d065fc50 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationReferencePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationReferencePolicyProvider.java @@ -23,43 +23,25 @@ import java.util.List; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicy; +import org.apache.tuscany.sca.binding.jms.policy.header.JMSHeaderPolicy; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Phase; import org.apache.tuscany.sca.invocation.PhasedInterceptor; import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.provider.BasePolicyProvider; import org.apache.tuscany.sca.provider.PolicyProvider; /** * @version $Rev$ $Date$ */ -public class JMSTokenAuthenticationReferencePolicyProvider implements PolicyProvider { +public class JMSTokenAuthenticationReferencePolicyProvider extends BasePolicyProvider<JMSTokenAuthenticationPolicy> { private EndpointReference endpointReference; public JMSTokenAuthenticationReferencePolicyProvider(EndpointReference endpointReference) { + super(JMSTokenAuthenticationPolicy.class, endpointReference); this.endpointReference = endpointReference; } - - private PolicySet findPolicySet() { - List<PolicySet> policySets = endpointReference.getPolicySets(); - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (JMSTokenAuthenticationPolicy.class.isInstance(p)) { - return ps; - } - } - } - return null; - } - - private String getContext() { - return "component.reference: " + endpointReference.getComponent().getURI() - + "#" - + endpointReference.getReference().getName() - + "(" - + endpointReference.getBinding().getClass().getName() - + ")"; - } - + /** * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) */ @@ -76,10 +58,4 @@ public class JMSTokenAuthenticationReferencePolicyProvider implements PolicyProv return Phase.REFERENCE_BINDING_POLICY; } - public void start() { - } - - public void stop() { - } - } diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationServicePolicyProvider.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationServicePolicyProvider.java index be5ca5dd61..351b1c3f0f 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationServicePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/authentication/token/provider/JMSTokenAuthenticationServicePolicyProvider.java @@ -19,48 +19,26 @@ package org.apache.tuscany.sca.binding.jms.policy.authentication.token.provider; -import java.util.List; - import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicy; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Phase; import org.apache.tuscany.sca.invocation.PhasedInterceptor; import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.provider.PolicyProvider; +import org.apache.tuscany.sca.provider.BasePolicyProvider; /** * @version $Rev$ $Date$ */ -public class JMSTokenAuthenticationServicePolicyProvider implements PolicyProvider { +public class JMSTokenAuthenticationServicePolicyProvider extends BasePolicyProvider<JMSTokenAuthenticationPolicy> { private Endpoint endpoint; public JMSTokenAuthenticationServicePolicyProvider(Endpoint endpoint) { + super(JMSTokenAuthenticationPolicy.class, endpoint); this.endpoint = endpoint; } - private PolicySet findPolicySet() { - List<PolicySet> policySets = endpoint.getPolicySets(); - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (JMSTokenAuthenticationPolicy.class.isInstance(p)) { - return ps; - } - } - } - return null; - } - - private String getContext() { - return "component.service: " + endpoint.getComponent().getURI() - + "#" - + endpoint.getService().getName() - + "(" - + endpoint.getBinding().getClass().getName() - + ")"; - } - /** * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) */ @@ -76,10 +54,4 @@ public class JMSTokenAuthenticationServicePolicyProvider implements PolicyProvid return Phase.SERVICE_BINDING_POLICY; } - public void start() { - } - - public void stop() { - } - } diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/provider/JMSHeaderReferencePolicyProvider.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/provider/JMSHeaderReferencePolicyProvider.java index 29fc08ed14..3f994da033 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/provider/JMSHeaderReferencePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/provider/JMSHeaderReferencePolicyProvider.java @@ -27,6 +27,7 @@ import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Phase; import org.apache.tuscany.sca.invocation.PhasedInterceptor; import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.provider.BasePolicyProvider; import org.apache.tuscany.sca.provider.PolicyProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; @@ -34,34 +35,14 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentReference; /** * @version $Rev$ $Date$ */ -public class JMSHeaderReferencePolicyProvider implements PolicyProvider { +public class JMSHeaderReferencePolicyProvider extends BasePolicyProvider<JMSHeaderPolicy> { private EndpointReference endpointReference; public JMSHeaderReferencePolicyProvider(EndpointReference endpointReference) { + super(JMSHeaderPolicy.class, endpointReference); this.endpointReference = endpointReference; } - - private PolicySet findPolicySet() { - List<PolicySet> policySets = endpointReference.getPolicySets(); - for (PolicySet ps : policySets) { - for (Object p : ps.getPolicies()) { - if (JMSHeaderPolicy.class.isInstance(p)) { - return ps; - } - } - } - return null; - } - - private String getContext() { - return "component.reference: " + endpointReference.getComponent().getURI() - + "#" - + endpointReference.getReference().getName() - + "(" - + endpointReference.getBinding().getClass().getName() - + ")"; - } /** * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation) @@ -78,10 +59,5 @@ public class JMSHeaderReferencePolicyProvider implements PolicyProvider { return Phase.REFERENCE_BINDING_POLICY; } - public void start() { - } - - public void stop() { - } } |