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);
}
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);
}
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;
}
Aggregations