diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-04 03:05:08 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-04 03:05:08 +0000 |
commit | 9e5182c9550f5a16066f1526a49f3cec857b9e31 (patch) | |
tree | ab76a0bbef8b08fb73bd3857653aeee6e0429fce /sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org | |
parent | 65339790224060a0389c6d75e58395ff50fecc9d (diff) |
TUSCANY-3485 - Making TransactionManagerHelper plugable as a utility
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918832 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org')
2 files changed, 10 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java index 71f32093d1..6d67e51bd7 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java +++ b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java @@ -31,6 +31,9 @@ import javax.transaction.SystemException; import javax.transaction.Transaction; import javax.transaction.TransactionManager; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; + /** * @version $Rev$ $Date$ */ @@ -39,6 +42,12 @@ public class TransactionManagerHelper { private TransactionManager tm; + public TransactionManagerHelper(ExtensionPointRegistry registry) { + super(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + this.tm = utilities.getUtility(TransactionManager.class); + } + public TransactionManagerHelper(TransactionManager tm) { super(); this.tm = tm; diff --git a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java index 726d3e7c91..23c25c9b8a 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java +++ b/sca-java-2.x/trunk/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java @@ -19,7 +19,6 @@ package org.apache.tuscany.sca.policy.transaction.runtime; -import javax.transaction.TransactionManager; import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; @@ -39,8 +38,7 @@ public class TransactionPolicyProviderFactory implements PolicyProviderFactory<T public TransactionPolicyProviderFactory(ExtensionPointRegistry registry) { super(); UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - TransactionManager tm = utilities.getUtility(TransactionManager.class); - this.helper = new TransactionManagerHelper(tm); + this.helper = utilities.getUtility(TransactionManagerHelper.class); } public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) { |