public static String getType(final Class<? extends ConfiguredObject> clazz) { String type = getActualType(clazz); if ("".equals(type)) { Class<? extends ConfiguredObject> category = getCategory(clazz); if (category == null) { throw new IllegalArgumentException("No category for " + clazz.getSimpleName()); } ManagedObject annotation = category.getAnnotation(ManagedObject.class); if (annotation == null) { throw new NullPointerException("No definition found for category " + category.getSimpleName()); } if (!"".equals(annotation.defaultType())) { type = annotation.defaultType(); } else { type = category.getSimpleName(); } } return type; }
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); }
_supportedTypes.put(categoryName, new ArrayList<String>()); ManagedObject annotation = categoryClass.getAnnotation(ManagedObject.class); if (annotation != null && !"".equals(annotation.defaultType())) _defaultTypes.put(categoryName, annotation.defaultType());