@Beta public interface PluginContext extends FeatureFlagsProvider
Modifier and Type | Method and Description |
---|---|
PluginProperties |
getPluginProperties(String pluginId)
Gets the
PluginProperties associated with the given plugin id. |
PluginProperties |
getPluginProperties(String pluginId,
MacroEvaluator evaluator)
Gets the
PluginProperties associated with the given plugin id. |
<T> Class<T> |
loadPluginClass(String pluginId)
Loads and returns a plugin class as specified by the given plugin id.
|
<T> T |
newPluginInstance(String pluginId)
Creates a new instance of a plugin.
|
<T> T |
newPluginInstance(String pluginId,
MacroEvaluator evaluator)
Creates a new instance of a plugin.
|
isFeatureEnabled
PluginProperties getPluginProperties(String pluginId)
PluginProperties
associated with the given plugin id.pluginId
- the unique identifier provide when declaring plugin usage in the program.PluginProperties
.IllegalArgumentException
- if pluginId is not foundUnsupportedOperationException
- if the program does not support pluginInvalidPluginConfigException
- if the plugin config could not be created from the
given propertiesPluginProperties getPluginProperties(String pluginId, MacroEvaluator evaluator) throws InvalidMacroException
PluginProperties
associated with the given plugin id. If a plugin field has a
macro, the parameter evaluator is used to evaluate the macro and the evaluated value is used
for the plugin field.pluginId
- the unique identifier provide when declaring plugin usage in the program.evaluator
- the macro evaluator that's used to evaluate macro for plugin field if
macro is supported on those fields.PluginProperties
.IllegalArgumentException
- if pluginId is not foundUnsupportedOperationException
- if the program does not support pluginInvalidMacroException
- if there is an exception during macro evaluationInvalidPluginConfigException
- if the plugin config could not be created from the
given properties<T> Class<T> loadPluginClass(String pluginId)
T
- the class type of the pluginpluginId
- the unique identifier provide when declaring plugin usage in the program.Class
.IllegalArgumentException
- if pluginId is not foundUnsupportedOperationException
- if the program does not support pluginInvalidPluginConfigException
- if the plugin config could not be created from the
given properties<T> T newPluginInstance(String pluginId) throws InstantiationException
PluginConfig
setup with PluginProperties
provided at the time when the PluginConfigurer.usePlugin(String, String, String, PluginProperties)
was called during the
program configuration time.T
- the class type of the pluginpluginId
- the unique identifier provide when declaring plugin usage in the program.InstantiationException
- if failed create a new instanceIllegalArgumentException
- if pluginId is not foundUnsupportedOperationException
- if the program does not support pluginInvalidPluginConfigException
- if the plugin config could not be created from the
given properties<T> T newPluginInstance(String pluginId, MacroEvaluator evaluator) throws InstantiationException, InvalidMacroException
PluginConfig
setup with PluginProperties
provided at the time when the PluginConfigurer.usePlugin(String, String, String, PluginProperties)
was called during the
program configuration time. If a plugin field has a macro, the parameter evaluator is used to
evaluate the macro and the evaluated value is used for the plugin field.T
- the class type of the pluginpluginId
- the unique identifier provide when declaring plugin usage in the program.evaluator
- the macro evaluator that's used to evaluate macro for plugin field if
macro is supported on those fields.InstantiationException
- if failed create a new instanceIllegalArgumentException
- if pluginId is not foundUnsupportedOperationException
- if the program does not support pluginInvalidMacroException
- if there is an exception during macro evaluationInvalidPluginConfigException
- if the plugin config could not be created from the
given propertiesCopyright © 2024 Cask Data, Inc. Licensed under the Apache License, Version 2.0.