tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r657881 [3/9] - in /incubator/tuscany/java/sca: modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ modules/assembly-xml/src/main/resources/ modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ modules...
Date Mon, 19 May 2008 17:49:08 GMT
Modified: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java Mon May 19 10:49:04 2008
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
 import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
@@ -35,6 +36,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Artifact processor for Namespace export
@@ -48,10 +52,26 @@
     private static final String NAMESPACE = "namespace";
     
     private final NamespaceImportExportFactory factory;
+    private final Monitor monitor;
     
-    public NamespaceExportProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public NamespaceExportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory = modelFactories.getFactory(NamespaceImportExportFactory.class);
+        this.monitor = monitor;
     }
+    
+    /**
+     * Report a warning.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
 
     public QName getArtifactType() {
         return EXPORT;
@@ -78,6 +98,7 @@
                     if (EXPORT.equals(element)) {
                         String ns = reader.getAttributeValue(null, NAMESPACE);
                         if (ns == null) {
+                        	error("AttributeNameSpaceMissing", reader);
                             throw new ContributionReadException("Attribute 'namespace' is missing");
                         }
                         namespaceExport.setNamespace(ns);

Modified: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java Mon May 19 10:49:04 2008
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
 import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
@@ -35,6 +36,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Artifact processor for Namespace import
@@ -50,11 +54,27 @@
     private static final String LOCATION = "location";
     
     private final NamespaceImportExportFactory factory;
+    private final Monitor monitor;
     
-    public NamespaceImportProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public NamespaceImportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory = modelFactories.getFactory(NamespaceImportExportFactory.class);
+        this.monitor = monitor;
     }
     
+    /**
+     * Report a warning.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
+    
     public QName getArtifactType() {
         return IMPORT;
     }
@@ -80,6 +100,7 @@
                     if (IMPORT.equals(element)) {
                         String ns = reader.getAttributeValue(null, NAMESPACE);
                         if (ns == null) {
+                        	error("AttributeNameSpaceMissing", reader);
                             throw new ContributionReadException("Attribute 'namespace' is missing");
                         }
                         namespaceImport.setNamespace(ns);

Added: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,22 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+AttributeNameSpaceMissing = Attribute 'namespace' is missing
+

Propchange: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -59,7 +59,7 @@
         ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -59,7 +59,7 @@
         ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java Mon May 19 10:49:04 2008
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -35,6 +36,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Artifact processor for Resource export
@@ -48,10 +52,26 @@
     private static final String URI = "uri";
     
     private final ResourceImportExportFactory factory;
+    private final Monitor monitor;
     
-    public ResourceExportProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public ResourceExportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory = modelFactories.getFactory(ResourceImportExportFactory.class);
+        this.monitor = monitor;
     }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
 
     public QName getArtifactType() {
         return EXPORT_RESOURCE;
@@ -78,6 +98,7 @@
                     if (EXPORT_RESOURCE.equals(element)) {
                         String uri = reader.getAttributeValue(null, URI);
                         if (uri == null) {
+                        	error("AttributeURIMissing", reader);
                             throw new ContributionReadException("Attribute 'uri' is missing");
                         }
                         resourceExport.setURI(uri);

Modified: incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java Mon May 19 10:49:04 2008
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -35,6 +36,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Artifact processor for Namespace import
@@ -50,11 +54,27 @@
     private static final String LOCATION = "location";
     
     private final ResourceImportExportFactory factory;
+    private final Monitor monitor;
     
-    public ResourceImportProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public ResourceImportProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory = modelFactories.getFactory(ResourceImportExportFactory.class);
+        this.monitor = monitor;
     }
     
+    /**
+     * Report a warning.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
+    
     public QName getArtifactType() {
         return IMPORT_RESOURCE;
     }
@@ -80,7 +100,8 @@
                     if (IMPORT_RESOURCE.equals(element)) {
                         String uri = reader.getAttributeValue(null, URI);
                         if (uri == null) {
-                            throw new ContributionReadException("Attribute 'namespace' is missing");
+                        	error("AttributeURIMissing", reader);
+                            throw new ContributionReadException("Attribute 'uri' is missing");
                         }
                         resourceImport.setURI(uri);
 

Added: incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,22 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+AttributeURIMissing = Attribute 'uri' is missing
+

Propchange: incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -58,7 +58,7 @@
         ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -59,7 +59,7 @@
         ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java Mon May 19 10:49:04 2008
@@ -22,6 +22,7 @@
 
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 /**
  * URLArtifactProcessor that handles sca-contribution-generated.xml files.
@@ -30,12 +31,16 @@
  */
 public class ContributionGeneratedMetadataDocumentProcessor extends ContributionMetadataDocumentProcessor {
 
-    public ContributionGeneratedMetadataDocumentProcessor(XMLInputFactory inputFactory, StAXArtifactProcessor staxProcessor) {
-        super(inputFactory, staxProcessor);
+    public ContributionGeneratedMetadataDocumentProcessor(XMLInputFactory inputFactory, 
+    													  StAXArtifactProcessor staxProcessor,
+    													  Monitor monitor) {
+        super(inputFactory, staxProcessor, monitor);
     }
     
-    public ContributionGeneratedMetadataDocumentProcessor(ModelFactoryExtensionPoint modelFactories, StAXArtifactProcessor staxProcessor) {
-        super(modelFactories, staxProcessor);
+    public ContributionGeneratedMetadataDocumentProcessor(ModelFactoryExtensionPoint modelFactories, 
+    													  StAXArtifactProcessor staxProcessor,
+    													  Monitor monitor) {
+        super(modelFactories, staxProcessor, monitor);
     }
     
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java Mon May 19 10:49:04 2008
@@ -28,6 +28,7 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ContributionMetadata;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
@@ -35,6 +36,9 @@
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * URLArtifactProcessor that handles sca-contribution.xml files.
@@ -44,15 +48,36 @@
 public class ContributionMetadataDocumentProcessor implements URLArtifactProcessor<ContributionMetadata>{
     private final StAXArtifactProcessor staxProcessor;
     private final XMLInputFactory inputFactory;
+    private final Monitor monitor;
 
-    public ContributionMetadataDocumentProcessor(XMLInputFactory inputFactory, StAXArtifactProcessor staxProcessor) {
+    public ContributionMetadataDocumentProcessor(XMLInputFactory inputFactory, 
+    											 StAXArtifactProcessor staxProcessor,
+    											 Monitor monitor) {
         this.inputFactory = inputFactory;
-        this.staxProcessor = staxProcessor; 
+        this.staxProcessor = staxProcessor;
+        this.monitor = monitor;
     }
     
-    public ContributionMetadataDocumentProcessor(ModelFactoryExtensionPoint modelFactories, StAXArtifactProcessor staxProcessor) {
+    public ContributionMetadataDocumentProcessor(ModelFactoryExtensionPoint modelFactories, 
+    											 StAXArtifactProcessor staxProcessor,
+    											 Monitor monitor) {
         this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
-        this.staxProcessor = staxProcessor; 
+        this.staxProcessor = staxProcessor;
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-xml-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	}
     }
     
     public String getArtifactType() {
@@ -80,9 +105,13 @@
             return contribution;
             
         } catch (XMLStreamException e) {
-            throw new ContributionReadException(e);
+        	ContributionReadException ex = new ContributionReadException(e);
+        	error("XMLStreamException", inputFactory, ex);
+        	throw ex;
         } catch (IOException e) {
-            throw new ContributionReadException(e);
+        	ContributionReadException ex = new ContributionReadException(e);
+        	error("IOException", inputFactory, ex);
+            throw ex;
         } finally {
             try {
                 if (urlStream != null) {

Modified: incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java Mon May 19 10:49:04 2008
@@ -30,6 +30,7 @@
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
 import org.apache.tuscany.sca.contribution.ContributionMetadata;
 import org.apache.tuscany.sca.contribution.Export;
@@ -41,6 +42,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Processor for contribution metadata
@@ -58,17 +62,39 @@
     private final ContributionFactory contributionFactory;
     
     private final StAXArtifactProcessor<Object> extensionProcessor;
+    private Monitor monitor;
 
-    public ContributionMetadataProcessor(AssemblyFactory assemblyFactory, ContributionFactory contributionFactory, StAXArtifactProcessor<Object> extensionProcessor) {
+    public ContributionMetadataProcessor(AssemblyFactory assemblyFactory, 
+    									 ContributionFactory contributionFactory, 
+    									 StAXArtifactProcessor<Object> extensionProcessor,
+    									 Monitor monitor) {
         this.assemblyFactory = assemblyFactory;
         this.contributionFactory = contributionFactory;
         this.extensionProcessor = extensionProcessor;
+        this.monitor = monitor;
     }
     
-    public ContributionMetadataProcessor(ModelFactoryExtensionPoint modelFactories, StAXArtifactProcessor<Object> extensionProcessor) {
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-xml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
+     
+    public ContributionMetadataProcessor(ModelFactoryExtensionPoint modelFactories, 
+    									 StAXArtifactProcessor<Object> extensionProcessor,
+    									 Monitor monitor) {
         this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
         this.extensionProcessor = extensionProcessor;
+        this.monitor = monitor;
     }
     
     
@@ -102,6 +128,7 @@
                         // Read <deployable>
                         QName compositeName = getQName(reader, "composite");
                         if (compositeName == null) {
+                        	error("AttributeCompositeMissing", reader);
                             throw new ContributionReadException("Attribute 'composite' is missing");
                         }
 

Added: incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,23 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+XMLStreamException = XMLStreamException occured due to:
+IOException = IOException occured due to:
+AttributeCompositeMissing = Attribute 'composite' is missing
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -72,7 +72,7 @@
         outputFactory = XMLOutputFactory.newInstance();
         
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
     }
 
     public void testRead() throws Exception {

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java Mon May 19 10:49:04 2008
@@ -37,9 +37,12 @@
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
 import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
 import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
 
 /**
  * The default implementation of an extension point for StAX artifact processors.
@@ -51,8 +54,10 @@
 
     private ExtensionPointRegistry extensionPoints;
     private ModelFactoryExtensionPoint modelFactories;
+    private MonitorFactory monitorFactory;
     private boolean loaded;
     private StAXArtifactProcessor<Object> extensibleStAXProcessor;
+    private Monitor monitor = null;
 
     /**
      * Constructs a new extension point.
@@ -62,7 +67,11 @@
         this.modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
         XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
-        this.extensibleStAXProcessor = new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory);
+        UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+        if (monitorFactory != null)
+        	this.monitor = monitorFactory.createMonitor();
+        this.extensibleStAXProcessor = new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory, this.monitor);
     }
 
     public void addArtifactProcessor(StAXArtifactProcessor artifactProcessor) {
@@ -153,7 +162,8 @@
             // Create a processor wrapper and register it
             StAXArtifactProcessor processor =
                 new LazyStAXArtifactProcessor(artifactType, modelTypeName, factoryName,
-                                              processorDeclaration, extensionPoints, modelFactories, extensibleStAXProcessor);
+                                              processorDeclaration, extensionPoints, modelFactories, 
+                                              extensibleStAXProcessor, monitor);
             addArtifactProcessor(processor);
         }
 
@@ -174,6 +184,7 @@
         private StAXArtifactProcessor processor;
         private Class<?> modelType;
         private StAXArtifactProcessor<Object> extensionProcessor;
+        private Monitor monitor;
 
         LazyStAXArtifactProcessor(QName artifactType,
                                   String modelTypeName,
@@ -181,7 +192,8 @@
                                   ServiceDeclaration processorDeclaration,
                                   ExtensionPointRegistry extensionPoints,
                                   ModelFactoryExtensionPoint modelFactories,
-                                  StAXArtifactProcessor<Object> extensionProcessor) {
+                                  StAXArtifactProcessor<Object> extensionProcessor,
+                                  Monitor monitor) {
 
             this.extensionPoints = extensionPoints;
             this.artifactType = artifactType;
@@ -189,6 +201,7 @@
             this.factoryName = factoryName;
             this.processorDeclaration = processorDeclaration;
             this.extensionProcessor = extensionProcessor;
+            this.monitor = monitor;
         }
 
         public QName getArtifactType() {
@@ -221,13 +234,15 @@
                                                           PolicyFactory.class,
                                                           QName.class,
                                                           Class.class,
-                                                          Object.class);
+                                                          Object.class,
+                                                          Monitor.class);
                         processor =
                             constructor.newInstance(assemblyFactory,
                                                     policyFactory,
                                                     artifactType,
                                                     getModelType(),
-                                                    modelFactory);
+                                                    modelFactory,
+                                                    monitor);
                     } catch (Exception e) {
                         throw new IllegalStateException(e);
                     }
@@ -240,17 +255,35 @@
                             (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
                         try {
                             Constructor<StAXArtifactProcessor> constructor =
-                                processorClass.getConstructor(ModelFactoryExtensionPoint.class);
-                            processor = constructor.newInstance(modelFactories);
+                                processorClass.getConstructor(ModelFactoryExtensionPoint.class, Monitor.class);
+                            processor = constructor.newInstance(modelFactories, monitor);
                         } catch (NoSuchMethodException e) {
                             try {
                                 Constructor<StAXArtifactProcessor> constructor =
-                                    processorClass.getConstructor(ModelFactoryExtensionPoint.class, StAXArtifactProcessor.class);
-                                processor = constructor.newInstance(modelFactories, extensionProcessor);
+                                    processorClass.getConstructor(ModelFactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
+                                processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
                             } catch (NoSuchMethodException e2) {
-                                Constructor<StAXArtifactProcessor> constructor =
-                                    processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
-                                processor = constructor.newInstance(extensionPoints, extensionProcessor);
+                                try {
+                                    Constructor<StAXArtifactProcessor> constructor =
+                                        processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
+                                    processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
+                                } catch (NoSuchMethodException e3) {
+                                    try {
+                                        Constructor<StAXArtifactProcessor> constructor =
+                                            processorClass.getConstructor(ModelFactoryExtensionPoint.class);
+                                        processor = constructor.newInstance(modelFactories);
+                                    } catch (NoSuchMethodException e4) {
+                                        try {
+                                            Constructor<StAXArtifactProcessor> constructor =
+                                                processorClass.getConstructor(ModelFactoryExtensionPoint.class, StAXArtifactProcessor.class);
+                                            processor = constructor.newInstance(modelFactories, extensionProcessor);
+                                        } catch (NoSuchMethodException e5) {
+                                            Constructor<StAXArtifactProcessor> constructor =
+                                                processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
+                                            processor = constructor.newInstance(extensionPoints, extensionProcessor);
+                                        }
+                                    }
+                                }
                             }
                         }
                     } catch (Exception e) {

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java Mon May 19 10:49:04 2008
@@ -33,8 +33,12 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
 import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
 
 /**
  * The default implementation of a URL artifact processor extension point.
@@ -48,6 +52,7 @@
     private ExtensionPointRegistry extensionPoints;
     private StAXArtifactProcessor<?> staxProcessor;
     private boolean loaded;
+    private Monitor monitor = null;
 
     /**
      * Constructs a new extension point.
@@ -57,8 +62,12 @@
         ModelFactoryExtensionPoint modelFactories = this.extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
         XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
+        UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+        if (monitorFactory != null) 
+        	this.monitor = monitorFactory.createMonitor();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, this.monitor);
     }
 
     public void addArtifactProcessor(URLArtifactProcessor artifactProcessor) {
@@ -113,7 +122,8 @@
             String modelTypeName = attributes.get("model");
             
             // Create a processor wrapper and register it
-            URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, processorDeclaration, extensionPoints, staxProcessor);
+            URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, 
+            		processorDeclaration, extensionPoints, staxProcessor, monitor);
             addArtifactProcessor(processor);
         }
         
@@ -133,17 +143,20 @@
         private URLArtifactProcessor processor;
         private Class<?> modelType;
         private StAXArtifactProcessor<?> staxProcessor;
+        private Monitor monitor;
         
         LazyURLArtifactProcessor(String artifactType, 
         		String modelTypeName, 
         		ServiceDeclaration processorDeclaration,
         		ExtensionPointRegistry extensionPoints, 
-                        StAXArtifactProcessor<?> staxProcessor) {
+                        StAXArtifactProcessor<?> staxProcessor,
+                        Monitor monitor) {
             this.artifactType = artifactType;
             this.modelTypeName = modelTypeName;
             this.processorDeclaration = processorDeclaration;
             this.extensionPoints = extensionPoints;
             this.staxProcessor = staxProcessor;
+            this.monitor = monitor;
         }
 
         public String getArtifactType() {
@@ -157,15 +170,15 @@
                     ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
                     Class<URLArtifactProcessor> processorClass = (Class<URLArtifactProcessor>)processorDeclaration.loadClass();
                     try {
-                        Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ModelFactoryExtensionPoint.class);
-                        processor = constructor.newInstance(modelFactories);
+                        Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ModelFactoryExtensionPoint.class, Monitor.class);
+                        processor = constructor.newInstance(modelFactories, monitor);
                     } catch (NoSuchMethodException e) {
                         try {
-                            Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ModelFactoryExtensionPoint.class, StAXArtifactProcessor.class);
-                            processor = constructor.newInstance(modelFactories, staxProcessor);
+                            Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ModelFactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
+                            processor = constructor.newInstance(modelFactories, staxProcessor, monitor);
                         } catch (NoSuchMethodException e2) {
-                            Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
-                            processor = constructor.newInstance(extensionPoints, staxProcessor);
+                            Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
+                            processor = constructor.newInstance(extensionPoints, staxProcessor, monitor);
                         }
                     }
                 } catch (Exception e) {

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java Mon May 19 10:49:04 2008
@@ -26,9 +26,13 @@
 import java.net.URL;
 import java.util.List;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.service.ContributionException;
 import org.apache.tuscany.sca.contribution.service.TypeDescriber;
 import org.apache.tuscany.sca.contribution.service.UnsupportedPackageTypeException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Implementation of an extensible package processor.
@@ -42,21 +46,41 @@
 
     private PackageProcessorExtensionPoint processors;
     private TypeDescriber packageTypeDescriber;
+    private Monitor monitor;
 
-    public ExtensiblePackageProcessor(PackageProcessorExtensionPoint processors, TypeDescriber packageTypeDescriber) {
+    public ExtensiblePackageProcessor(PackageProcessorExtensionPoint processors, 
+    								  TypeDescriber packageTypeDescriber,
+    								  Monitor monitor) {
         this.processors = processors; 
         this.packageTypeDescriber = packageTypeDescriber;
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Marshals errors into the monitor
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    protected void error(String message, Object model, Object... messageParameters) {
+    	if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	}
     }
 
     public List<URI> getArtifacts(URL packageSourceURL, InputStream inputStream) 
         throws ContributionException, IOException {
         String packageType = this.packageTypeDescriber.getType(packageSourceURL, null);
         if (packageType == null) {
+        	error("UnsupportedPackageTypeException", packageTypeDescriber, packageSourceURL.toString());
             throw new UnsupportedPackageTypeException("Unsupported contribution package type: " + packageSourceURL.toString());
         }
 
         PackageProcessor packageProcessor = this.processors.getPackageProcessor(packageType);
         if (packageProcessor == null) {
+        	error("UnsupportedPackageTypeException", packageTypeDescriber, packageType);
             throw new UnsupportedPackageTypeException("Unsupported contribution package type: " + packageType);
         }
 

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java Mon May 19 10:49:04 2008
@@ -33,11 +33,15 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.contribution.service.UnrecognizedElementException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Implementation of an extensible StAX artifact processor.
@@ -54,6 +58,7 @@
     private XMLInputFactory inputFactory;
     private XMLOutputFactory outputFactory;
     private StAXArtifactProcessorExtensionPoint processors;
+    private Monitor monitor;
 
     /**
      * Constructs a new ExtensibleStAXArtifactProcessor.
@@ -61,7 +66,10 @@
      * @param inputFactory
      * @param outputFactory
      */
-    public ExtensibleStAXArtifactProcessor(StAXArtifactProcessorExtensionPoint processors, XMLInputFactory inputFactory, XMLOutputFactory outputFactory) {
+    public ExtensibleStAXArtifactProcessor(StAXArtifactProcessorExtensionPoint processors, 
+    									   XMLInputFactory inputFactory, 
+    									   XMLOutputFactory outputFactory,
+    									   Monitor monitor) {
         super();
         this.processors = processors;
         this.inputFactory = inputFactory;
@@ -69,7 +77,37 @@
         if (this.outputFactory != null) {
             this.outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
         }
+        this.monitor = monitor;
     }
+    
+    /**
+     * Report a warning.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void warning(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+     }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+    		 Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
+    	     monitor.problem(problem);
+    	 }        
+     }
+
 
     public Object read(XMLStreamReader source) throws ContributionReadException, XMLStreamException {
         
@@ -81,10 +119,11 @@
         QName name = source.getName();
         StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name);
         if (processor == null) {
-            if (logger.isLoggable(Level.WARNING)) {
-                Location location = source.getLocation();
+        	Location location = source.getLocation();
+            if (logger.isLoggable(Level.WARNING)) {                
                 logger.warning("Element " + name + " cannot be processed. (" + location + ")");
             }
+            warning("ElementCannotBeProcessed", processors, name, location);
             return null;
         }
         return processor.read(source);
@@ -102,6 +141,7 @@
                 if (logger.isLoggable(Level.WARNING)) {
                     logger.warning("No StAX processor is configured to handle " + model.getClass());
                 }
+                warning("NoStaxProcessor", processors, model.getClass());
             }
         }
     }
@@ -144,6 +184,7 @@
                     Location location = reader.getLocation();
                     e.setLine(location.getLineNumber());
                     e.setColumn(location.getColumnNumber());
+                    //error("ContributionReadException", reader, e);
                     throw e;
                 } finally {
                     try {
@@ -161,6 +202,7 @@
             }
         } catch (XMLStreamException e) {
             ContributionReadException ce = new ContributionReadException(e);
+            error("ContributionReadException", inputFactory, ce);
             throw ce;
         }
     }
@@ -178,7 +220,9 @@
             writer.flush();
             writer.close();
         } catch (XMLStreamException e) {
-            throw new ContributionWriteException(e);
+        	ContributionWriteException cw = new ContributionWriteException(e);
+        	error("ContributionWriteException", outputFactory, cw);
+            throw cw;
         }
     }
 

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java Mon May 19 10:49:04 2008
@@ -21,10 +21,14 @@
 import java.net.URI;
 import java.net.URL;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.UnrecognizedElementException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Implementation of an extensible URL artifact processor.
@@ -38,14 +42,30 @@
     implements URLArtifactProcessor<Object> {
     
     private URLArtifactProcessorExtensionPoint processors;
+    private Monitor monitor;
 
     /**
      * Constructs a new ExtensibleURLArtifactProcessor.
      * 
      * @param processors
      */
-    public ExtensibleURLArtifactProcessor(URLArtifactProcessorExtensionPoint processors) {
+    public ExtensibleURLArtifactProcessor(URLArtifactProcessorExtensionPoint processors, Monitor monitor) {
         this.processors = processors;
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Object... messageParameters) {
+    	if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	}
     }
 
     @SuppressWarnings("unchecked")
@@ -96,6 +116,7 @@
         } else {
             UnrecognizedElementException e = new UnrecognizedElementException(null);
             e.setResourceURI(artifactURI.toString());
+            error("UnrecognizedElementException", processors, "null", artifactURI.toString());
             throw e;
         }
     }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/resources/contribution-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/resources/contribution-validation-messages.properties?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/resources/contribution-validation-messages.properties (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/resources/contribution-validation-messages.properties Mon May 19 10:49:04 2008
@@ -20,4 +20,10 @@
 #
 SchemaError = XMLSchema validation error occured in: {0} ,line = {1}, column = {2}, Message = {3}
 SchemaFatalError = XMLSchema validation fatal error occured in: {0} ,line = {1}, column = {2}, Message = {3}
-SchemaWarning = XMLSchema validation warning occured in: {0} ,line = {1}, column = {2}, Message = {3}
\ No newline at end of file
+SchemaWarning = XMLSchema validation warning occured in: {0} ,line = {1}, column = {2}, Message = {3}
+UnsupportedPackageTypeException = Unsupported contribution package type: {0}
+ElementCannotBeProcessed = Element {0} cannot be processed. ({1})
+NoStaxProcessor = No StAX processor is configured to handle {0}
+ContributionWriteException = ContributionWriteException occured due to :
+ContributionReadException = ContributionReadException occured due to :
+UnrecognizedElementException = Unrecognized Element found {0} : {1}
\ No newline at end of file

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ReferenceParameterProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ReferenceParameterProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ReferenceParameterProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ReferenceParameterProcessor.java Mon May 19 10:49:04 2008
@@ -31,6 +31,7 @@
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.runtime.ReferenceParameters;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 /**
  * Artifact processor for reference parameters.
@@ -40,13 +41,13 @@
 public class ReferenceParameterProcessor implements StAXArtifactProcessor<ReferenceParameters> {
     private static final QName REFERENCE_PARAMETERS =
         new QName("http://tuscany.apache.org/xmlns/sca/1.0", "referenceParameters", "tuscany");
-
+    
     /**
      * Constructs a new processor.
      * 
      * @param modelFactories
      */
-    public ReferenceParameterProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public ReferenceParameterProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/data-engine-helper/src/main/java/org/apache/tuscany/sca/data/engine/ConnectionInfoArtifactProcessor.java Mon May 19 10:49:04 2008
@@ -25,6 +25,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
@@ -34,6 +35,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
 import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Implements a StAX artifact processor for ConnectionInfo.
@@ -49,14 +53,29 @@
     public static final QName CONNECTION_INFO = new QName(Constants.SCA10_TUSCANY_NS, "connectionInfo");
     private static final QName CONNECTION_PROPERTIES = new QName(Constants.SCA10_TUSCANY_NS, "connectionProperties");
     
-    public ConnectionInfoArtifactProcessor(ModelFactoryExtensionPoint modelFactories) {
-
+    private Monitor monitor;
+    public ConnectionInfoArtifactProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    	this.monitor = monitor;
     }
 
     public QName getArtifactType() {
         // Returns the QName of the XML element processed by this processor
         return CONNECTION_INFO;
     }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "dataengine-helper-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	 }
+    }
 
     public Class<ConnectionInfo> getModelType() {
         // Returns the type of model processed by this processor
@@ -96,7 +115,9 @@
                     event = reader.next();
                 }
             } catch (XMLStreamException e) {
-                throw new ContributionReadException(e);
+            	ContributionReadException ce = new ContributionReadException(e);
+            	error("ContributionReadException", reader, ce);
+                throw ce;
             }
 
             QName element = reader.getName();

Added: incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,21 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ContributionReadException = ContributionReadException occured due to : 
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/data-engine-helper/src/main/resources/dataengine-helper-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java Mon May 19 10:49:04 2008
@@ -33,6 +33,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
@@ -42,6 +43,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 import commonj.sdo.helper.HelperContext;
 import commonj.sdo.helper.XSDHelper;
@@ -56,9 +60,39 @@
 public class ImportSDOProcessor implements StAXArtifactProcessor<ImportSDO> {
     
     private ContributionFactory contributionFactory;
+    private Monitor monitor;
 
-    public ImportSDOProcessor(ModelFactoryExtensionPoint modelFactories) {
-        contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+    public ImportSDOProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+        this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Object... messageParameters) {
+		 if (monitor != null) {
+		    Problem problem = new ProblemImpl(this.getClass().getName(), "databinding-sdo-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+		    monitor.problem(problem);
+		 }
+    }
+     
+     /**
+      * Report a exception.
+      * 
+      * @param problems
+      * @param message
+      * @param model
+      */
+    private void error(String message, Object model, Exception ex) {
+     	 if (monitor != null) {
+     		 Problem problem = new ProblemImpl(this.getClass().getName(), "databinding-sdo-validation-messages", Severity.ERROR, model, message, ex);
+     	     monitor.problem(problem);
+     	 }        
     }
 
     public QName getXMLType() {
@@ -95,6 +129,7 @@
             ClassReference reference = new ClassReference(factoryName);
             ClassReference resolved = resolver.resolveModel(ClassReference.class, reference);
             if (resolved == null || resolved.isUnresolved()) {
+            	error("FailToResolveClass", resolver, factoryName);
                 ContributionResolveException loaderException =
                     new ContributionResolveException("Fail to resolve class: " + factoryName);
                 throw loaderException;
@@ -103,7 +138,9 @@
                 Class<?> factoryClass = resolved.getJavaClass();
                 register(factoryClass, importSDO.getHelperContext());
             } catch (Exception e) {
-                throw new ContributionResolveException(e);
+            	ContributionResolveException ce = new ContributionResolveException(e);
+            	error("ContributionResolveException", resolver, ce);
+                throw ce;
             }
             importSDO.setUnresolved(false);
         }
@@ -127,6 +164,7 @@
                 artifact.setURI(location);
                 artifact = resolver.resolveModel(Artifact.class, artifact);
                 if (artifact.getLocation() == null) {
+                	error("FailToResolveLocation", resolver, location);
                     ContributionResolveException loaderException =
                         new ContributionResolveException("Fail to resolve location: " + location);
                     throw loaderException;
@@ -143,7 +181,9 @@
                     xsdInputStream.close();
                 }
             } catch (IOException e) {
-                throw new ContributionResolveException(e);
+            	ContributionResolveException ce = new ContributionResolveException(e);
+            	error("ContributionResolveException", resolver, ce);
+                throw ce;
             }
             importSDO.setUnresolved(false);
         }

Added: incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,25 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+FailToResolveClass = Fail to resolve class: {0}
+FailToResolveLocation = Fail to resolve location: {0}
+ContributionResolveException = ContributionResolveException occured due to:
+IOException = IOException occured due to:
+AttributeCompositeMissing = Attribute 'composite' is missing
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/databinding-sdo/src/main/resources/databinding-sdo-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -69,7 +69,7 @@
 
     @Override
     protected void setUp() throws Exception {
-        loader = new ImportSDOProcessor(new DefaultModelFactoryExtensionPoint());
+        loader = new ImportSDOProcessor(new DefaultModelFactoryExtensionPoint(), null);
         xmlFactory = XMLInputFactory.newInstance();
     }
 



Mime
View raw message