public interface PluginProvider<C extends PluginConfiguration>
Ignite plugins are loaded using JDK ServiceLoader
.
First method called to initialize plugin is initExtensions(PluginContext, ExtensionRegistry)
.
If plugin requires configuration it can be set in IgniteConfiguration
using
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)
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()
void initExtensions(PluginContext ctx, ExtensionRegistry registry) throws IgniteCheckedException
ctx
- Plugin context.registry
- Extension registry.IgniteCheckedException
@Nullable <T> T createComponent(PluginContext ctx, Class<T> cls)
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.void validateNewNode(ClusterNode node) throws PluginValidationException
node
- Joining node.PluginValidationException
- If cluster-wide plugin validation failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019