public final class SystemDirectiveRegistry extends Object implements DirectiveRegistry
DirectiveRegistry for maintaining a registry
of system provided directives. The directives maintained within this registry and
present and loaded by the Classloader that is responsible for loading this
class.
In order to load the directives, this class scans through all classes that
implement the interface Directive. Instead of scanning entire JAR, it uses the
package name a starting point for scanning the classes that implement the Directive
interface.
For every class found, this scan will create a instance of DirectiveInfo
object and store it in the registry.
| Modifier and Type | Field and Description |
|---|---|
static SystemDirectiveRegistry |
INSTANCE |
| Constructor and Description |
|---|
SystemDirectiveRegistry(List<String> namespaces)
This constructor uses the user provided namespace as starting pointing
for scanning classes that implement the interface
Directive. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes any resources acquired during initialization or otherwise.
|
DirectiveInfo |
get(String name)
Given the name of the directive, returns the information related to the directive.
|
DirectiveInfo |
get(String namespace,
String name)
Given the name of the directive, returns the information related to the directive.
|
ArtifactSummary |
getLatestWranglerArtifact()
Retrieve latest Wrangler transform artifact information
|
Iterable<DirectiveInfo> |
list(String namespace)
List the directives in the specified namespace
|
void |
reload(String namespace)
This method reloads the directives from the artifacts into the registry.
|
public static final SystemDirectiveRegistry INSTANCE
public SystemDirectiveRegistry(List<String> namespaces) throws DirectiveLoadException
Directive.namespaces - that is used as starting point for scanning classes.DirectiveLoadException - thrown if there are any issue loading the directive.public DirectiveInfo get(String namespace, String name)
get in interface DirectiveRegistryname - of the directive to be retrieved from the registry.namespace - the namespace of the directiveDirectiveInfo if found, else null.public DirectiveInfo get(String name)
name - of the directive to be retrieved from the registry.DirectiveInfo if found, else null.public void reload(String namespace)
DirectiveRegistryreload in interface DirectiveRegistrynamespace - the namespace to reload directives in@Nullable public ArtifactSummary getLatestWranglerArtifact()
DirectiveRegistrygetLatestWranglerArtifact in interface DirectiveRegistrypublic Iterable<DirectiveInfo> list(String namespace)
DirectiveRegistrylist in interface DirectiveRegistrynamespace - the namespace to list fromDirectiveInfo objects
maintained within the registry.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2024 CDAP Licensed under the Apache License, Version 2.0.