diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-04 16:43:19 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-04 16:43:19 +0000 |
commit | 292f4bbb201e20c025426b310ed62e306bd96210 (patch) | |
tree | 237cb620f803374c2834c39e1f3d5ac5ca775d81 /sca-java-2.x/trunk/modules/assembly | |
parent | 3ec81c5828e707ae52a283f285e83889b82fb989 (diff) |
Move the runtime over to use Axis2 1.5.1. Three main parts to this 1) replace binding-ws-axis2 and binding binding-ws-axis2-policy with binding-ws-runtime-axis which is still very much a work in progress 2) correct the axis/axiom version references across the project and make the various OSGi environments work 3) start fixing policy provides to allow the ws binding to exploit the binding wire.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@906557 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java index f87938a5cb..1ff7280d07 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java @@ -21,9 +21,11 @@ package org.apache.tuscany.sca.policy.util; import java.util.ArrayList; import java.util.Collection; +import java.util.List; import javax.xml.namespace.QName; +import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicyExpression; @@ -93,5 +95,35 @@ public class PolicyHelper { } return policies; } + + public static PolicySet getPolicySet(Binding wsBinding, QName intentName) { + PolicySet returnPolicySet = null; + + if (wsBinding instanceof PolicySubject) { + PolicySubject policiedBinding = (PolicySubject)wsBinding; + for (PolicySet policySet : policiedBinding.getPolicySets()) { + for (Intent intent : policySet.getProvidedIntents()) { + if (intent.getName().equals(intentName)) { + returnPolicySet = policySet; + break; + } + } + } + } + + return returnPolicySet; + } + + public static boolean isIntentRequired(Binding wsBinding, QName intent) { + if (wsBinding instanceof PolicySubject) { + List<Intent> intents = ((PolicySubject)wsBinding).getRequiredIntents(); + for (Intent i : intents) { + if (intent.equals(i.getName())) { + return true; + } + } + } + return getPolicySet(wsBinding, intent) != null; + } } |