diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-03 17:16:49 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-03 17:16:49 +0000 |
commit | 46f24f4efd75292aa302fae47c724a826c50cbca (patch) | |
tree | b1b73cc0ceb284def7bc4cc82c7baa695d3cae10 /sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java | |
parent | f107805b29332ba31b9185b2ee5f6e3cf9d7b37c (diff) |
Updating/Cleaning up policyProvider code that creates intercetor to better utilize base class
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java index 37f3034718..c2a7c1039b 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java @@ -25,8 +25,6 @@ import org.apache.tuscany.sca.assembly.Endpoint; 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.PolicyExpression; -import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; import org.apache.tuscany.sca.provider.BasePolicyProvider; @@ -35,24 +33,15 @@ import org.apache.tuscany.sca.provider.BasePolicyProvider; */ public class TransactionServicePolicyProvider extends BasePolicyProvider<TransactionPolicy> { private TransactionManagerHelper helper; - private List<PolicySet> policySets; public TransactionServicePolicyProvider(TransactionManagerHelper helper, Endpoint ep) { super(TransactionPolicy.class, ep); this.helper = helper; - this.policySets = ep.getPolicySets(); } public PhasedInterceptor createInterceptor(Operation operation) { - for (PolicySet policySet : policySets) { - for (PolicyExpression p : policySet.getPolicies()) { - if (p.getPolicy() instanceof TransactionPolicy) { - TransactionInterceptor interceptor = new TransactionInterceptor(helper, true, (TransactionPolicy)p.getPolicy(), null, getPhase()); - return interceptor; - } - } - } - return null; + List<TransactionPolicy> policies = findPolicies(); + return policies.isEmpty() ? null : new TransactionInterceptor(helper, true, policies.get(0), null, getPhase()); } public String getPhase() { |