diff options
Diffstat (limited to 'sca-java-2.x')
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) { |