diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-22 09:12:47 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-22 09:12:47 +0000 |
commit | 017d141d3df74bd849cba03166dd4784a53ca92a (patch) | |
tree | 640c895a2a9ad5eecf332cd0e893f19efa0ad3be /java/sca/modules/monitor/src/main | |
parent | e7c92f890cc711971a086b77300e340fbfa804b3 (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@767422 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/monitor/src/main')
-rw-r--r-- | java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java | 12 | ||||
-rw-r--r-- | java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java b/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java index f0ac8a6dbb..14366b423d 100644 --- a/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java +++ b/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java @@ -76,4 +76,16 @@ public interface Monitor { */ Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Object... messageParams ); + /** + * Set the name of an artifact for which errors are Monitored + * @param artifactName the artifact name + */ + void setArtifactName( String artifactName ); + + /** + * Get the name of the artifact for which errors are Monitored + * @return the name of the Artifact or null if no artifact name has been set + */ + String getArtifactName(); + } diff --git a/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java b/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java index fa562a5f23..ca0c7d865c 100644 --- a/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java +++ b/java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java @@ -38,6 +38,9 @@ public class MonitorImpl implements Monitor { // Cache all the problem reported to monitor for further analysis private List<Problem> problemCache = new ArrayList<Problem>(); + + // Name of an artifact for which problems are being Monitored + private String artifactName = null; public void problem(Problem problem) { @@ -89,4 +92,12 @@ public class MonitorImpl implements Monitor { public Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Object... messageParams) { return new ProblemImpl(sourceClassName, bundleName, severity, problemObject, messageId, messageParams); } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } } |