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/TransactionReferencePolicyProvider.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/TransactionReferencePolicyProvider.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java index a982a2ceed..1dc0feb0b5 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java @@ -25,8 +25,6 @@ import org.apache.tuscany.sca.assembly.EndpointReference; 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,25 +33,15 @@ import org.apache.tuscany.sca.provider.BasePolicyProvider; */ public class TransactionReferencePolicyProvider extends BasePolicyProvider<TransactionPolicy> { private TransactionManagerHelper helper; - private List<PolicySet> policySets; public TransactionReferencePolicyProvider(TransactionManagerHelper helper, EndpointReference epr) { super(TransactionPolicy.class, epr); this.helper = helper; - this.policySets = epr.getPolicySets(); } public PhasedInterceptor createInterceptor(Operation operation) { - /* TODO - 2.x better way of doing this in 2.x */ - 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() { |