Class ExtensionRegistry

java.lang.Object
org.metricshub.jawk.ext.ExtensionRegistry

public final class ExtensionRegistry extends Object
Registry used by extensions and the CLI to expose ready-to-use extension instances.
  • Method Details

    • register

      public static void register(String name, JawkExtension extension)
      Registers an extension instance under the supplied name.
      Parameters:
      name - identifying name
      extension - extension instance
    • listExtensions

      public static Map<String,JawkExtension> listExtensions()
      Returns a snapshot of all registered extensions sorted by name.
      Returns:
      immutable view of registered extensions
    • resolve

      public static JawkExtension resolve(String name)
      Resolves an extension name to the registered instance. The lookup is case-insensitive and also supports class names. When the extension has not yet been registered, the method attempts to load the class by name and instantiate it.
      Parameters:
      name - name or class name of the extension
      Returns:
      extension instance, or null when the name cannot be resolved