diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-29 15:06:57 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-29 15:06:57 +0000 |
commit | 17e573358db8a4a83247037b957db32127bdd00a (patch) | |
tree | 6f5fdc4e5169f822571dd7b02e3a023d16a351c1 /sca-java-2.x/trunk/modules/monitor/src/main | |
parent | a0a8ac0a56f74f88e0ffbc54aa45a85dbb14c419 (diff) |
TUSCANY-4020 - move hardcoded message strings into properties files
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1295144 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/monitor/src/main')
2 files changed, 17 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java b/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java index eca0b9aba1..91f6bc9a9f 100644 --- a/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java +++ b/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java @@ -375,4 +375,15 @@ public abstract class Monitor { return errorDetected; } + + /** + * Helper method to retrieve a localized message from a given bundle with a given + * message ID string + * + * @Param loggerName - the name of the logger to use + * @param messageBundleName - the name of the bundle to use + * @param messageID - the ID of the message to retrieve + * @return the message string + */ + public abstract String getMessageString(String loggerName, String messageBundleName, String messageID); } diff --git a/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java b/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java index c81581aae0..eb022a9616 100644 --- a/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java +++ b/sca-java-2.x/trunk/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java @@ -141,4 +141,10 @@ public class MonitorImpl extends Monitor { problemCache.clear(); artifactName = null; } + + @Override + public String getMessageString(String loggerName, String messageBundleName, String messageID){ + Logger problemLogger = Logger.getLogger(loggerName, messageBundleName); + return problemLogger.getResourceBundle().getString(messageID); + } } |