Search in sources :

Example 1 with ConfiguredObjectAttributeInjector

use of org.apache.qpid.server.plugin.ConfiguredObjectAttributeInjector in project qpid-broker-j by apache.

the class ConfiguredObjectTypeRegistry method processAttributesTypesAndFields.

private <X extends ConfiguredObject> void processAttributesTypesAndFields(final Class<X> clazz) {
    Map<String, ConfiguredObjectAttribute<?, ?>> attrMap = new TreeMap<>(NAME_COMPARATOR);
    Map<String, AutomatedField> fieldMap = new HashMap<String, AutomatedField>();
    Collection<ConfiguredObjectAttribute<?, ?>> attrCol = _allAttributes.get(clazz);
    for (ConfiguredObjectAttribute<?, ?> attr : attrCol) {
        attrMap.put(attr.getName(), attr);
        if (attr.isAutomated()) {
            fieldMap.put(attr.getName(), findField(attr, clazz));
        }
    }
    for (ConfiguredObjectAttributeInjector injector : _attributeInjectors) {
        for (ConfiguredObjectInjectedAttribute<?, ?> attr : injector.getInjectedAttributes()) {
            if (!attrMap.containsKey(attr.getName()) && attr.appliesToConfiguredObjectType((Class<? extends ConfiguredObject<?>>) clazz)) {
                attrMap.put(attr.getName(), attr);
            }
        }
    }
    _allAttributeTypes.put(clazz, attrMap);
    _allAutomatedFields.put(clazz, fieldMap);
}
Also used : HashMap(java.util.HashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ConfiguredObjectAttributeInjector(org.apache.qpid.server.plugin.ConfiguredObjectAttributeInjector) TreeMap(java.util.TreeMap)

Aggregations

HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConfiguredObjectAttributeInjector (org.apache.qpid.server.plugin.ConfiguredObjectAttributeInjector)1