[jboss-svn-commits] JBL Code SVN: r30954 - labs/jbossesb/branches/JBESB_4_7_CP/product/rosetta/src/org/jboss/soa/esb/dom.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jan 5 23:28:41 EST 2010
Author: beve
Date: 2010-01-05 23:28:40 -0500 (Tue, 05 Jan 2010)
New Revision: 30954
Modified:
labs/jbossesb/branches/JBESB_4_7_CP/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
Log:
Work for https://jira.jboss.org/jira/browse/JBESB-3094 "YADOMUtil's createDocument method creates a new DocumentBuilderFactory upon every invocation"
Modified: labs/jbossesb/branches/JBESB_4_7_CP/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_7_CP/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java 2010-01-06 04:26:44 UTC (rev 30953)
+++ labs/jbossesb/branches/JBESB_4_7_CP/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java 2010-01-06 04:28:40 UTC (rev 30954)
@@ -35,7 +35,6 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
@@ -45,6 +44,8 @@
import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.util.DOMUtil;
+import org.jboss.soa.esb.util.TransformerUtil;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -62,9 +63,10 @@
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
public class YADOMUtil {
-
- // If there are another set of the same utilities somewhere, or another DOMUtil type class
+
+ // If there are another set of the same utilities somewhere, or another DOMUtil type class
// that we can add them too, we should do that :-)
+
/**
* Create a new W3C Document.
@@ -77,7 +79,7 @@
Document doc = null;
try {
- doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ doc = DOMUtil.getDocuementBuilderFactory().newDocumentBuilder().newDocument();
} catch (ParserConfigurationException e) {
throw new ConfigurationException("Failed to create ESB Configuration Document instance.", e);
}
@@ -229,7 +231,7 @@
serialize(node, streamRes, false);
}
- /**
+ /**
* Serialize the supplied DOM node to the supplied DOM StreamResult instance.
* @param node The DOM node to be serialised.
* @param streamRes The StreamResult into which the node is to be serialised.
@@ -240,7 +242,7 @@
DOMSource domSource = new DOMSource(node);
try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ Transformer transformer = TransformerUtil.getTransformerFactory().newTransformer();
// There's a bug in Java 5 re this code (formatting).
// See http://forum.java.sun.com/thread.jspa?threadID=562510&start=0 and it explains the
More information about the jboss-svn-commits
mailing list