summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/contribution
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-04-22 09:11:18 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-04-22 09:11:18 +0000
commite7c92f890cc711971a086b77300e340fbfa804b3 (patch)
tree2048f39bd43a022ec92dc4d383f98ed53ee1719a /java/sca/modules/contribution
parent7612cad0e3d56f665cfe227127980056ef5ea15e (diff)
Extended Monitoring to give better diagnostic messages which include the name of the artifact being processed.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@767420 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/contribution')
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java
index 3f5582d4e7..ac7b644703 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java
@@ -83,14 +83,14 @@ class ValidatingXMLStreamReader extends TuscanyXMLStreamReader implements XMLStr
// get the metadata we need from the document
handler.setErrorHandler(new ErrorHandler() {
private String getMessage(SAXParseException e) {
- return "XMLSchema validation problem in: " + e.getSystemId() + ", line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n" + e.getMessage();
+ return "XMLSchema validation problem in: " + getArtifactName( e.getSystemId() ) + ", line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n" + e.getMessage();
}
public void error(SAXParseException exception) throws SAXException {
if (ValidatingXMLStreamReader.this.monitor == null)
logger.warning(getMessage(exception));
else
- ValidatingXMLStreamReader.this.error("SchemaError", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
+ ValidatingXMLStreamReader.this.error("SchemaError", ValidatingXMLStreamReader.this.getClass(), getArtifactName( exception.getSystemId() ),
exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
}
@@ -98,7 +98,7 @@ class ValidatingXMLStreamReader extends TuscanyXMLStreamReader implements XMLStr
if (ValidatingXMLStreamReader.this.monitor == null)
logger.warning(getMessage(exception));
else
- ValidatingXMLStreamReader.this.error("SchemaFatalError", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
+ ValidatingXMLStreamReader.this.error("SchemaFatalError", ValidatingXMLStreamReader.this.getClass(), getArtifactName( exception.getSystemId() ),
exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
}
@@ -106,9 +106,17 @@ class ValidatingXMLStreamReader extends TuscanyXMLStreamReader implements XMLStr
if (ValidatingXMLStreamReader.this.monitor == null)
logger.warning(getMessage(exception));
else
- ValidatingXMLStreamReader.this.warning("SchemaWarning", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
+ ValidatingXMLStreamReader.this.warning("SchemaWarning", ValidatingXMLStreamReader.this.getClass(), getArtifactName( exception.getSystemId() ),
exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
}
+
+ private String getArtifactName( String input ) {
+ String artifactName = input;
+ if( ValidatingXMLStreamReader.this.monitor != null ) {
+ artifactName = ValidatingXMLStreamReader.this.monitor.getArtifactName();
+ }
+ return artifactName;
+ }
});
}