summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-21 11:56:14 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-21 11:56:14 +0000
commitf265fa28ac8115c5ae664a62a0c8f110343d955f (patch)
treefe8bf7941f574809d8bcab4f8ec9b585f3941341 /java
parentdaac67ff4255bd4c65892eb42c76ac74807c0bdf (diff)
Set correct monitor on the ValidatingXMLInputFactory so that any errors that it finds are reported successfully
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@827971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java7
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java7
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java11
3 files changed, 22 insertions, 3 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
index 8a28efb461..2969e257d6 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
@@ -46,7 +46,7 @@ import org.apache.tuscany.sca.monitor.Monitor;
* @version $Rev$ $Date$
*/
public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements URLArtifactProcessor<Composite> {
- private XMLInputFactory inputFactory;
+ private ValidatingXMLInputFactory inputFactory;
/**
@@ -94,6 +94,11 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements
monitor.setArtifactName(uri.toString());
} //end if
+ // set the monitor on the input factory as the standard XMLInputFactory
+ // methods used for creating readers don't allow for the context to
+ // be passed in
+ inputFactory.setMonitor(context.getMonitor());
+
XMLStreamReader reader = inputFactory.createXMLStreamReader(scdlStream);
reader.nextTag();
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
index f1ef36d0f9..a6e7e8b6e3 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
@@ -93,8 +93,6 @@ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory
this.inputFactory = factoryExtensionPoint.getFactory(XMLInputFactory.class);
this.documentBuilderFactory = factoryExtensionPoint.getFactory(DocumentBuilderFactory.class);
this.schemas = registry.getExtensionPoint(ValidationSchemaExtensionPoint.class);
- this.monitor =
- registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(MonitorFactory.class).createMonitor();
this.helper = StAXHelper.getInstance(registry);
}
@@ -109,6 +107,11 @@ public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory
this.schemas = schemas;
this.monitor = monitor;
}
+
+ @Override
+ public void setMonitor(Monitor monitor) {
+ this.monitor = monitor;
+ }
/**
* Report a exception.
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
index c0eef5a7a8..2446862e07 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
@@ -21,10 +21,21 @@ package org.apache.tuscany.sca.contribution.processor;
import javax.xml.stream.XMLInputFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
/**
* Base marker class for validating XML input factories.
*
* @version $Rev$ $Date$
*/
public abstract class ValidatingXMLInputFactory extends XMLInputFactory {
+
+ /**
+ * Allows the monitor to be set in lieu of the context being passed
+ * into the create methods. The base definitions of the create methods
+ * don't allow for this.
+ *
+ * @param monitor the current monitor object
+ */
+ public abstract void setMonitor(Monitor monitor);
}