public interface PluginProvider<C extends PluginConfiguration>
Ignite plugins can be loaded using JDK ServiceLoader
or set up explicitly via
IgniteConfiguration.setPluginProviders(PluginProvider[])
.
First method called to initialize plugin is initExtensions(PluginContext, ExtensionRegistry)
.
If ServiceLoader
approach of plugin loading is chosen, fully-qualified PluginProvider
class name is
used as the service type. And required plugin configuration in this case can be set up via
IgniteConfiguration.setPluginConfigurations(PluginConfiguration...)
.
Modifier and Type | Method and Description |
---|---|
String |
copyright() |
CachePluginProvider |
createCacheProvider(CachePluginContext ctx)
Creates cache plugin provider.
|
<T> T |
createComponent(PluginContext ctx,
Class<T> cls)
Creates Ignite component.
|
void |
initExtensions(PluginContext ctx,
ExtensionRegistry registry)
Registers extensions.
|
String |
name() |
void |
onIgniteStart()
Callback that notifies that Ignite has successfully started,
including all internal components.
|
void |
onIgniteStop(boolean cancel)
Callback to notify that Ignite is about to stop.
|
<T extends IgnitePlugin> |
plugin() |
@Nullable Serializable |
provideDiscoveryData(UUID nodeId)
Gets plugin discovery data object that will be sent to the new node
during discovery process.
|
void |
receiveDiscoveryData(UUID nodeId,
Serializable data)
Receives plugin discovery data object from remote nodes (called
on new node during discovery process).
|
void |
start(PluginContext ctx)
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
void |
validateNewNode(ClusterNode node)
Deprecated.
Use
validateNewNode(ClusterNode, Serializable) instead. |
default void |
validateNewNode(ClusterNode node,
Serializable data)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
String |
version() |
String name()
String version()
String copyright()
<T extends IgnitePlugin> T plugin()
T
- Type of the plugin.void initExtensions(PluginContext ctx, ExtensionRegistry registry) throws IgniteCheckedException
ctx
- Plugin context.registry
- Extension registry.IgniteCheckedException
@Nullable <T> T createComponent(PluginContext ctx, Class<T> cls)
T
- Ignite component type.ctx
- Plugin context.cls
- Ignite component class.null
if component is not supported.CachePluginProvider createCacheProvider(CachePluginContext ctx)
ctx
- Plugin context.void start(PluginContext ctx) throws IgniteCheckedException
ctx
- Plugin context.IgniteCheckedException
- Throws in case of any errors.void stop(boolean cancel) throws IgniteCheckedException
cancel
- If true
, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException
- Thrown in case of any errors.void onIgniteStart() throws IgniteCheckedException
IgniteCheckedException
- Thrown in case of any errors.void onIgniteStop(boolean cancel)
cancel
- Flag indicating whether jobs should be canceled.@Nullable @Nullable Serializable provideDiscoveryData(UUID nodeId)
nodeId
- ID of new node that joins topology.null
if there is nothing
to send for this component.void receiveDiscoveryData(UUID nodeId, Serializable data)
provideDiscoveryData(UUID)
method on the other nodes.nodeId
- Remote node ID.data
- Discovery data object or null
if nothing was
sent for this component.@Deprecated void validateNewNode(ClusterNode node) throws PluginValidationException
validateNewNode(ClusterNode, Serializable)
instead.node
- Joining node.PluginValidationException
- If cluster-wide plugin validation failed.default void validateNewNode(ClusterNode node, Serializable data)
node
- Joining node.data
- Discovery data object or null
if nothing was
sent for this component.PluginValidationException
- If cluster-wide plugin validation failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023