diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-07-29 14:54:36 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-07-29 14:54:36 +0000 |
| commit | 63887e9ffebaa10f33f4afdfe6f88c359d844a8d (patch) | |
| tree | 07c2b69b6a026868d985941b327df2afca88b8e3 /qpid/java/broker-core | |
| parent | 242b0827d0ff650b973775e47786018372ae4fea (diff) | |
| download | qpid-python-63887e9ffebaa10f33f4afdfe6f88c359d844a8d.tar.gz | |
QPID-5940 : [Java Broker] Add meta-data servlet
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1614370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-core')
| -rw-r--r-- | qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java index 950638cd63..d692e663df 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java @@ -99,6 +99,10 @@ public class ConfiguredObjectTypeRegistry { categories.add(configuredObjectClass); } + else + { + categories.add(getCategory(configuredObjectClass)); + } if (!"".equals(annotation.type())) { types.add(configuredObjectClass); @@ -188,13 +192,16 @@ public class ConfiguredObjectTypeRegistry { Class<? extends ConfiguredObject> category = getCategory(clazz); Set<Class<? extends ConfiguredObject>> types = _knownTypes.get(category); - for(Class<? extends ConfiguredObject> type : types) + if(types != null) { - ManagedObject annotation = type.getAnnotation(ManagedObject.class); - if(typeName.equals(annotation.type())) + for (Class<? extends ConfiguredObject> type : types) { - typeClass = type; - break; + ManagedObject annotation = type.getAnnotation(ManagedObject.class); + if (typeName.equals(annotation.type())) + { + typeClass = type; + break; + } } } if(typeClass == null && typeName.equals(category.getSimpleName())) @@ -214,7 +221,12 @@ public class ConfiguredObjectTypeRegistry { throw new IllegalArgumentException("Cannot locate ManagedObject information for " + clazz.getName()); } - return Collections.unmodifiableCollection(_knownTypes.get(categoryClass)); + Set<Class<? extends ConfiguredObject>> classes = _knownTypes.get(categoryClass); + if(classes == null) + { + classes = (Set<Class<? extends ConfiguredObject>>) ((Set)Collections.singleton(clazz)); + } + return Collections.unmodifiableCollection(classes); } @@ -225,7 +237,8 @@ public class ConfiguredObjectTypeRegistry { throw new IllegalArgumentException("Cannot locate ManagedObject information for " + clazz.getName()); } - return Collections.unmodifiableCollection(_typeSpecificAttributes.get(typeClass)); + Collection<ConfiguredObjectAttribute<?, ?>> typeAttrs = _typeSpecificAttributes.get(typeClass); + return Collections.unmodifiableCollection(typeAttrs == null ? Collections.<ConfiguredObjectAttribute<?, ?>>emptySet() : typeAttrs); } public static String getType(final Class<? extends ConfiguredObject> clazz) @@ -711,7 +724,7 @@ public class ConfiguredObjectTypeRegistry } - static Map<String, ConfiguredObjectAttribute<?, ?>> getAttributeTypes(final Class<? extends ConfiguredObject> clazz) + public static Map<String, ConfiguredObjectAttribute<?, ?>> getAttributeTypes(final Class<? extends ConfiguredObject> clazz) { if(!_allAttributes.containsKey(clazz)) { |
