// Dynamically load an extension point class declared under META-INF/services
try {
ServiceDeclaration extensionPointDeclaration =
ServiceDiscovery.getInstance().getServiceDeclaration(extensionPointType.getName());
if (extensionPointDeclaration != null) {
Class<?> extensionPointClass = extensionPointDeclaration.loadClass();
// Construct the extension point
Constructor<?>[] constructors = extensionPointClass.getConstructors();
Constructor<?> constructor =
getConstructor(constructors, new Class<?>[] {ExtensionPointRegistry.class});