User: stacycurl
Date: 01/04/10 13:47:53
Modified: src/main/org/jbossmx/cluster/watchdog/util/xml
XMLScripter.java
Log:
Cleaned up XMLScripter.
XMLScripter will now propagate out XMLScriptException thrown by
NodeProcessors, rather than squashing them
Revision Changes Path
1.2 +7 -46
jbossmx/src/main/org/jbossmx/cluster/watchdog/util/xml/XMLScripter.java
Index: XMLScripter.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmx/src/main/org/jbossmx/cluster/watchdog/util/xml/XMLScripter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLScripter.java 2001/03/29 13:49:35 1.1
+++ XMLScripter.java 2001/04/10 20:47:53 1.2
@@ -27,7 +27,6 @@
import java.util.HashMap;
public class XMLScripter
-//extends DefaultHandler
{
public XMLScripter(XMLContext xmlContext, final String rootTag)
{
@@ -43,17 +42,6 @@
m_nodeProcessorts = new HashMap();
}
-
-// public List getXMLetEntries()
-// {
-// return m_xmletEntries;
-// }
-
-// public void addXMLetEntry(final XMLetEntry xmletEntry)
-// {
-// m_xmletEntries.add(xmletEntry);
-// }
-
public synchronized void addNodeProcessor(final NodeProcessor nodeProcessor)
{
m_nodeProcessorts.put(nodeProcessor.getNodeName(), nodeProcessor);
@@ -70,13 +58,13 @@
}
public synchronized void processDocument(String url)
- throws IOException, MalformedURLException, SAXException
+ throws IOException, MalformedURLException, SAXException, XMLScriptException
{
processDocument(new URL(url));
}
public synchronized void processDocument(URL url)
- throws IOException, SAXException
+ throws IOException, SAXException, XMLScriptException
{
m_url = url;
@@ -86,15 +74,13 @@
parser.parse(new InputSource(re));
m_document = parser.getDocument();
- System.out.println("--A.1");
NodeList nodeList = m_document.getChildNodes();
- System.out.println("--A.2");
processNodeList(nodeList);
- System.out.println("--A.3");
}
private void processNodeList(final NodeList nodeList)
+ throws XMLScriptException
{
for (int nLoop = 0; nLoop < nodeList.getLength(); ++nLoop)
{
@@ -104,9 +90,7 @@
{
addPluginNodeProcessor(node);
- System.out.println("--A.A");
processNodeList(node.getChildNodes());
- System.out.println("--A.B");
}
else
{
@@ -132,19 +116,12 @@
}
private void processNode(final Node node)
+ throws XMLScriptException
{
- try
- {
- System.out.println("--A.6 (" + node.getNodeName() + ")");
- final NodeProcessor nodeProcessor =
getNodeProcessor(node.getNodeName());
- if (nodeProcessor != null)
- {
- nodeProcessor.processNode(node, this, m_xmlContext);
- }
- }
- catch (XMLScriptException xe)
+ final NodeProcessor nodeProcessor = getNodeProcessor(node.getNodeName());
+ if (nodeProcessor != null)
{
- xe.printStackTrace();
+ nodeProcessor.processNode(node, this, m_xmlContext);
}
}
@@ -157,23 +134,7 @@
private XMLContext m_xmlContext;
-// private List m_xmletEntries;
-
private Map m_nodeProcessorts;
public static final String PLUGIN_TAG = "plugin";
-
-// private static final String ROOT_TAG = "xmlets";
-// private static final String MLET_TAG = "mlet";
-// private static final String XMLET_TAG = "mlet";
-// private static final String ARG_TAG = "arg";
-//
-// public static final String TYPE_ATTRIBUTE = "type";
-// public static final String VALUE_ATTRIBUTE = "value";
-// public static final String ARCHIVE_ATTRIBUTE = "archive";
-// public static final String CODEBASE_ATTRIBUTE = "codebase";
-// public static final String OBJECT_ATTRIBUTE = "object";
-// public static final String CODE_ATTRIBUTE = "code";
-// public static final String NAME_ATTRIBUTE = "name";
-// public static final String VERSION_ATTRIBUTE = "version";
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development