Search in sources :

Example 1 with ManagedObject

use of org.apache.qpid.server.model.ManagedObject in project qpid-broker-j by apache.

the class AbstractLogger method getSupportedLogInclusionRules.

private static Collection<String> getSupportedLogInclusionRules(Class<? extends ConfiguredObject> clazz) {
    final Iterable<ConfiguredObjectRegistration> registrations = (new QpidServiceLoader()).instancesOf(ConfiguredObjectRegistration.class);
    Set<String> supportedTypes = new HashSet<>();
    for (ConfiguredObjectRegistration registration : registrations) {
        for (Class<? extends ConfiguredObject> typeClass : registration.getConfiguredObjectClasses()) {
            if (clazz.isAssignableFrom(typeClass)) {
                ManagedObject annotation = typeClass.getAnnotation(ManagedObject.class);
                if (annotation.creatable() && annotation.defaultType().equals("") && LogBackLogInclusionRule.class.isAssignableFrom(typeClass)) {
                    supportedTypes.add(ConfiguredObjectTypeRegistry.getType(typeClass));
                }
            }
        }
    }
    return Collections.unmodifiableCollection(supportedTypes);
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) ConfiguredObjectRegistration(org.apache.qpid.server.plugin.ConfiguredObjectRegistration) ManagedObject(org.apache.qpid.server.model.ManagedObject) HashSet(java.util.HashSet)

Example 2 with ManagedObject

use of org.apache.qpid.server.model.ManagedObject in project qpid-broker-j by apache.

the class AbstractVirtualHostNode method getSupportedVirtualHostTypes.

protected static Collection<String> getSupportedVirtualHostTypes(boolean includeProvided) {
    final Iterable<ConfiguredObjectRegistration> registrations = (new QpidServiceLoader()).instancesOf(ConfiguredObjectRegistration.class);
    Set<String> supportedTypes = new HashSet<>();
    for (ConfiguredObjectRegistration registration : registrations) {
        for (Class<? extends ConfiguredObject> typeClass : registration.getConfiguredObjectClasses()) {
            if (VirtualHost.class.isAssignableFrom(typeClass)) {
                ManagedObject annotation = typeClass.getAnnotation(ManagedObject.class);
                if (annotation.creatable() && annotation.defaultType().equals("") && !NonStandardVirtualHost.class.isAssignableFrom(typeClass)) {
                    supportedTypes.add(ConfiguredObjectTypeRegistry.getType(typeClass));
                }
            }
        }
    }
    if (includeProvided) {
        supportedTypes.add(ProvidedStoreVirtualHostImpl.VIRTUAL_HOST_TYPE);
    }
    return Collections.unmodifiableCollection(supportedTypes);
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) ConfiguredObjectRegistration(org.apache.qpid.server.plugin.ConfiguredObjectRegistration) ManagedObject(org.apache.qpid.server.model.ManagedObject) HashSet(java.util.HashSet)

Example 3 with ManagedObject

use of org.apache.qpid.server.model.ManagedObject in project qpid-broker-j by apache.

the class MetaDataServlet method processType.

private Map<String, Object> processType(final Class<? extends ConfiguredObject> type, final Model model) {
    Map<String, Object> typeDetails = new LinkedHashMap<>();
    typeDetails.put("attributes", processAttributes(type, model));
    typeDetails.put("statistics", processStatistics(type, model));
    typeDetails.put("operations", processOperations(type, model));
    typeDetails.put("managedInterfaces", getManagedInterfaces(type, model));
    typeDetails.put("validChildTypes", getValidChildTypes(type, model));
    typeDetails.put("contextDependencies", getContextDependencies(type, model));
    ManagedObject annotation = type.getAnnotation(ManagedObject.class);
    if (annotation != null) {
        if (annotation.deprecated()) {
            typeDetails.put("deprecated", true);
        }
        if (!"".equals(annotation.description())) {
            typeDetails.put("description", annotation.description());
        }
    }
    return typeDetails;
}
Also used : ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) ManagedObject(org.apache.qpid.server.model.ManagedObject) ManagedObject(org.apache.qpid.server.model.ManagedObject) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ManagedObject (org.apache.qpid.server.model.ManagedObject)3 HashSet (java.util.HashSet)2 ConfiguredObjectRegistration (org.apache.qpid.server.plugin.ConfiguredObjectRegistration)2 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)2 LinkedHashMap (java.util.LinkedHashMap)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1