summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java12
-rw-r--r--java/sca/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java11
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;
+ }
}