tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r827971 - in /tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/
Date Wed, 21 Oct 2009 11:56:15 GMT
Author: slaws
Date: Wed Oct 21 11:56:14 2009
New Revision: 827971

URL: http://svn.apache.org/viewvc?rev=827971&view=rev
Log:
Set correct monitor on the ValidatingXMLInputFactory so that any errors that it finds are
reported successfully 

Modified:
    tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
    tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java

Modified: tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java?rev=827971&r1=827970&r2=827971&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
(original)
+++ tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
Wed Oct 21 11:56:14 2009
@@ -46,7 +46,7 @@
  * @version $Rev$ $Date$
  */
 public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements URLArtifactProcessor<Composite>
{
-    private XMLInputFactory inputFactory;
+    private ValidatingXMLInputFactory inputFactory;
     
 
     /**
@@ -94,6 +94,11 @@
             	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();

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java?rev=827971&r1=827970&r2=827971&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
(original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
Wed Oct 21 11:56:14 2009
@@ -93,8 +93,6 @@
         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 @@
         this.schemas = schemas;
         this.monitor = monitor;
     }
+    
+    @Override
+    public void setMonitor(Monitor monitor) {
+        this.monitor = monitor;
+    }
 
     /**
      * Report a exception.

Modified: tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java?rev=827971&r1=827970&r2=827971&view=diff
==============================================================================
--- tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
(original)
+++ tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
Wed Oct 21 11:56:14 2009
@@ -21,10 +21,21 @@
 
 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);
 }



Mime
View raw message