diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-05-18 14:44:06 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-05-18 14:44:06 +0000 |
| commit | 572338d0d96269b2db560205a668dc4f8ab37f4d (patch) | |
| tree | b6d450c3577acde7f856fa73fa297b6312175b2b /java/broker/src/main | |
| parent | deb70e1bd13d732f18abb69bc6511f9d22656e0f (diff) | |
| download | qpid-python-572338d0d96269b2db560205a668dc4f8ab37f4d.tar.gz | |
QPID-2581 : Update ConfigurationPlugin to correctly handle attributes in configuration.
Added work around for the fact that we use a Composite Configuration that turns an XML attribute key of '[@attribute]' in to '@attribute]'. Added test for to this conversion.
This makes the Plugin Configuration interface consistent so if we swap our configuration format. The key style of '[@attribute]' will work as expected.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@945681 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/main')
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java b/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java index dc0410dba6..bac6e5c4d7 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java +++ b/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java @@ -94,7 +94,7 @@ public abstract class ConfigurationPlugin //Trim any element properties elementNameIndex = element.indexOf("["); - if (elementNameIndex != -1) + if (elementNameIndex > 0) { element = element.substring(0,elementNameIndex).trim(); } @@ -106,6 +106,18 @@ public abstract class ConfigurationPlugin //Remove the items we already expect in the configuration for (String tag : getElementsProcessed()) { + + // Work round the issue with Commons configuration. + // With an XMLConfiguration the key will be [@property] + // but with a CompositeConfiguration it will be @property]. + // Hide this issue from our users so when/if we change the + // configuration they don't have to. + int bracketIndex = tag.indexOf("["); + if (bracketIndex != -1) + { + tag = tag.substring(bracketIndex + 1, tag.length()); + } + elements.remove(tag); } @@ -116,7 +128,7 @@ public abstract class ConfigurationPlugin _logger.info("Elements to lookup:" + path); for (String tag : elements) { - _logger.info(tag); + _logger.info("Tag:'"+tag+"'"); } } } |
