use of org.apache.qpid.server.plugin.ConfiguredObjectRegistration 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.plugin.ConfiguredObjectRegistration 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);
}
Aggregations