diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-08-06 09:43:12 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-08-06 09:43:12 +0000 |
| commit | e388a1c4c1b2ab03d3c0359dcfe106d182fb9259 (patch) | |
| tree | e18973dfedca25d4c40aabb90b5f33cfb7f0b6f9 /java/broker/src/velocity | |
| parent | 3e6d6768e884201949399b17e57a847472743b15 (diff) | |
| download | qpid-python-e388a1c4c1b2ab03d3c0359dcfe106d182fb9259.tar.gz | |
QPID-2002 : Completion of BrokerLoggingTest, the shutdown tests have been excluded due to QPID-2031. An update to the LogMessages.vm templates and ApplicationRegistry was requried. This is because BrokerMessages is loaded before the ApplicationRegistry is initialised. As a result the NullApplicationRegistry is created which should not be used. The AR is loaded to discover the current Locale. There were a couple of options here. Either always use the Default Locale and have the AR loading set that or add the ability to check if the AR has been configured. I chose the latter as knowing if an AR exists may be useful for our testing framework.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@801575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/velocity')
| -rw-r--r-- | java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm b/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm index 10be2299e9..e2fe7ec3c2 100644 --- a/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm +++ b/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm @@ -45,7 +45,21 @@ public class ${type.name}Messages static { - Locale currentLocale = ApplicationRegistry.getInstance().getConfiguration().getLocale(); + reload(); + } + + public static void reload() + { + Locale currentLocale; + + if (ApplicationRegistry.isConfigured()) + { + currentLocale = ApplicationRegistry.getInstance().getConfiguration().getLocale(); + } + else + { + currentLocale = Locale.getDefault(); + } _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.LogMessages", currentLocale); @@ -54,6 +68,7 @@ public class ${type.name}Messages _formatter.setLocale(currentLocale); } + ## ## The list stored under key 'list' in the 'type' HashMap contains all the ## log messages that this class should contain. So for each entry in the list |
