Package org.metricshub.jawk.ext
Class ExtensionRegistry
java.lang.Object
org.metricshub.jawk.ext.ExtensionRegistry
Registry used by extensions and the CLI to expose ready-to-use extension
instances.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,JawkExtension> Returns a snapshot of all registered extensions sorted by name.static voidregister(String name, JawkExtension extension) Registers an extension instance under the supplied name.static JawkExtensionResolves an extension name to the registered instance.
-
Method Details
-
register
Registers an extension instance under the supplied name.- Parameters:
name- identifying nameextension- extension instance
-
listExtensions
Returns a snapshot of all registered extensions sorted by name.- Returns:
- immutable view of registered extensions
-
resolve
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
nullwhen the name cannot be resolved
-