diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 04:27:18 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 04:27:18 +0000 |
commit | 3851a48be83618876ba18afe89d947e962056e17 (patch) | |
tree | 9c260a0880a5c0b294e0edcb518992670e0d8b3a /sca-java-2.x/trunk/modules/policy-transaction/src/main | |
parent | 97e3edce3ae2621e42b5941fecd690fec01b1f55 (diff) |
TUSCANY-3463 - Fixing up policy providers to PolicyExpression wrapper
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916115 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/policy-transaction/src/main')
4 files changed, 15 insertions, 15 deletions
diff --git a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java index 845b1be6f5..b0d3351992 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java +++ b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java @@ -24,6 +24,7 @@ import java.util.List; 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; @@ -44,12 +45,11 @@ public class TransactionImplementationPolicyProvider extends BasePolicyProvider< } public PhasedInterceptor createInterceptor(Operation operation) { -/* TODO - 2.x better way of doing this in 2.x */ + /* TODO - 2.x better way of doing this in 2.x */ for (PolicySet policySet : policySets) { - for (Object p : policySet.getPolicies()) { - if (p instanceof TransactionPolicy) { - TransactionInterceptor interceptor = - new TransactionInterceptor(helper, false, (TransactionPolicy)p, null, getPhase()); + for (PolicyExpression p : policySet.getPolicies()) { + if (p.getPolicy() instanceof TransactionPolicy) { + TransactionInterceptor interceptor = new TransactionInterceptor(helper, false, (TransactionPolicy)p, null, getPhase()); return interceptor; } } diff --git a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java index 9488475b12..97782403e4 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java +++ b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java @@ -69,7 +69,7 @@ public class TransactionInterceptor implements PhasedInterceptor { * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message) */ public Message invoke(Message msg) { - //logger.info("Executing TransactionInterceptor.invoke"); + logger.info("Executing TransactionInterceptor.invoke"); TransactionalInvocation invocation = new TransactionalInvocation(next, msg); Message result = null; diff --git a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java index c6bf3f0c71..a053c765b9 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java @@ -25,6 +25,7 @@ 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; @@ -43,12 +44,11 @@ public class TransactionReferencePolicyProvider extends BasePolicyProvider<Trans } public PhasedInterceptor createInterceptor(Operation operation) { -/* TODO - 2.x better way of doing this in 2.x */ + /* TODO - 2.x better way of doing this in 2.x */ for (PolicySet policySet : policySets) { - for (Object p : policySet.getPolicies()) { - if (p instanceof TransactionPolicy) { - TransactionInterceptor interceptor = - new TransactionInterceptor(helper, true, (TransactionPolicy)p, null,getPhase()); + for (PolicyExpression p : policySet.getPolicies()) { + if (p.getPolicy() instanceof TransactionPolicy) { + TransactionInterceptor interceptor = new TransactionInterceptor(helper, true, (TransactionPolicy)p, null,getPhase()); return interceptor; } } diff --git a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java index 8ba6ba7484..5c4039394a 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java +++ b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java @@ -25,6 +25,7 @@ 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; @@ -44,10 +45,9 @@ public class TransactionServicePolicyProvider extends BasePolicyProvider<Transac public PhasedInterceptor createInterceptor(Operation operation) { for (PolicySet policySet : policySets) { - for (Object p : policySet.getPolicies()) { - if (p instanceof TransactionPolicy) { - TransactionInterceptor interceptor = - new TransactionInterceptor(helper, true, (TransactionPolicy)p, null, getPhase()); + for (PolicyExpression p : policySet.getPolicies()) { + if (p.getPolicy() instanceof TransactionPolicy) { + TransactionInterceptor interceptor = new TransactionInterceptor(helper, true, (TransactionPolicy)p, null, getPhase()); return interceptor; } } |