summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/policy/src/main
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-09 09:17:30 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-09 09:17:30 +0000
commitdc15447dfebac2b0218cb1ce6903923c574c84df (patch)
tree5cf9aba844a018bccab0743005af5d3701e98cce /java/sca/modules/policy/src/main
parent7ea46da4356a04cd45cfa1cadcad9f7fdb28aa7f (diff)
Fixes to get the Equinox integration working. Use the parent classloader instead of the Thread context classloader as parent of the contribution classloader. Use the ServiceDiscovery to get instances of DocumentBuilderFactory and TransformerFactory. Pass these factories around instead of creating new instances in different places. Clarified the few prints in the calculator-osgi sample showing which classloader is used.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@693411 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/policy/src/main')
-rw-r--r--java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java
index aace23edf6..2e4c6a9d78 100644
--- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java
+++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java
@@ -341,10 +341,9 @@ public class PolicyComputationUtils {
}
}
- public static byte[] addApplicablePolicySets(InputStream is, Collection<PolicySet> domainPolicySets) throws Exception {
- DocumentBuilderFactory dbFac = DocumentBuilderFactory.newInstance();
- dbFac.setNamespaceAware(true);
- DocumentBuilder db = dbFac.newDocumentBuilder();
+ public static byte[] addApplicablePolicySets(InputStream is, Collection<PolicySet> domainPolicySets, DocumentBuilderFactory documentBuilderFactory) throws Exception {
+ documentBuilderFactory.setNamespaceAware(true);
+ DocumentBuilder db = documentBuilderFactory.newDocumentBuilder();
Document doc = db.parse(is);
is.close();
return addApplicablePolicySets(doc, domainPolicySets);