diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-20 20:10:37 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-20 20:10:37 +0000 |
commit | 3a8a64103bcc4891fb1a1f4cc4538f9d5b62a7ba (patch) | |
tree | ccd8919c277ad88c032acb3167fdd4645586cb07 /java/sca/modules/binding-ws-axis2-policy | |
parent | 7b9fa54dced70baffa6578b0be902b06092584a7 (diff) |
Start to implement the SCA policy framework 1.1 spec draft from OASIS OpenCSA
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@746356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-axis2-policy')
8 files changed, 17 insertions, 22 deletions
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java index 004d52be9c..b44d30002b 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java @@ -20,15 +20,13 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token; import javax.xml.namespace.QName;
-import org.apache.tuscany.sca.policy.Policy;
-
/**
* Implementation for policies that could be injected as parameter
* into the axis2config.
*
* @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
*/
-public class Axis2TokenAuthenticationPolicy implements Policy {
+public class Axis2TokenAuthenticationPolicy {
private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2TokenAuthentication");
public static final String AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME = "tokenName";
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java index 2226c691ee..4753012de4 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java @@ -26,7 +26,7 @@ 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.PolicySubject;
import org.apache.tuscany.sca.provider.PolicyProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
@@ -49,8 +49,8 @@ public class Axis2TokenAuthenticationReferencePolicyProvider implements PolicyPr }
private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+ if (binding instanceof PolicySubject) {
+ List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
for (PolicySet ps : policySets) {
for (Object p : ps.getPolicies()) {
if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java index 8a18e4f4af..d1be46d1ce 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java @@ -26,7 +26,7 @@ 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.PolicySubject;
import org.apache.tuscany.sca.provider.PolicyProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentService;
@@ -47,8 +47,8 @@ public class Axis2TokenAuthenticationServicePolicyProvider implements PolicyProv }
private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+ if (binding instanceof PolicySubject) {
+ List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
for (PolicySet ps : policySets) {
for (Object p : ps.getPolicies()) {
if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java index fa26fedc9e..43b6162bd0 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java @@ -24,7 +24,6 @@ import java.util.Map; import javax.xml.namespace.QName; import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.policy.Policy; /** * Implementation for policies that could be injected as parameter @@ -32,7 +31,7 @@ import org.apache.tuscany.sca.policy.Policy; * * @version $Rev$ $Date$ */ -public class Axis2ConfigParamPolicy implements Policy { +public class Axis2ConfigParamPolicy { private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; public static final QName NAME = new QName(SCA10_TUSCANY_NS, "wsConfigParam"); private Map<String, OMElement> paramElements = new Hashtable<String, OMElement>(); diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java index 5ac4e3f5fd..dfedaf97a5 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java @@ -23,7 +23,6 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.description.Parameter; import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.util.PolicyHandler; /** @@ -31,7 +30,7 @@ import org.apache.tuscany.sca.policy.util.PolicyHandler; * * @version $Rev$ $Date$ */ -public class Axis2ConfigParamPolicyHandler implements PolicyHandler { +public class Axis2ConfigParamPolicyHandler { private PolicySet applicablePolicySet = null; public void setUp(Object... context) { diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java index 0c9cf76a29..50388aef28 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java @@ -20,15 +20,13 @@ package org.apache.tuscany.sca.binding.ws.axis2.policy.header; import javax.xml.namespace.QName; -import org.apache.tuscany.sca.policy.Policy; - /** * Implementation for policies that could be injected as parameter * into the axis2config. * * @version $Rev$ $Date$ */ -public class Axis2HeaderPolicy implements Policy { +public class Axis2HeaderPolicy { private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0"; public static final QName AXIS2_HEADER_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2Header"); public static final String AXIS2_HEADER_NAME = "headerName"; diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java index 0176fee05d..d0fc58cd33 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java @@ -26,7 +26,7 @@ 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.PolicySubject; import org.apache.tuscany.sca.provider.PolicyProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; @@ -48,9 +48,10 @@ public class Axis2HeaderReferencePolicyProvider implements PolicyProvider { this.binding = binding; } + // FIXME: Need to use the endpoint with effective policies private PolicySet findPolicySet() { - if (binding instanceof PolicySetAttachPoint) { - List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets(); + if (binding instanceof PolicySubject) { + List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets(); for (PolicySet ps : policySets) { for (Object p : ps.getPolicies()) { if (Axis2HeaderPolicy.class.isInstance(p)) { diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java index 7a3ff2a48e..3cb6d8007b 100644 --- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java +++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java @@ -26,7 +26,7 @@ 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.PolicySubject; import org.apache.tuscany.sca.provider.PolicyProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentService; @@ -47,8 +47,8 @@ public class Axis2HeaderServicePolicyProvider implements PolicyProvider { } private PolicySet findPolicySet() { - if (binding instanceof PolicySetAttachPoint) { - List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets(); + if (binding instanceof PolicySubject) { + List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets(); for (PolicySet ps : policySets) { for (Object p : ps.getPolicies()) { if (Axis2HeaderPolicy.class.isInstance(p)) { |