Package org.apache.ignite.plugin
Interface PluginProvider<C extends PluginConfiguration>
-
public interface PluginProvider<C extends PluginConfiguration>Pluggable Ignite component.Ignite plugins can be loaded using JDK
ServiceLoaderor set up explicitly viaIgniteConfiguration.setPluginProviders(PluginProvider[]). First method called to initialize plugin isinitExtensions(PluginContext, ExtensionRegistry). IfServiceLoaderapproach of plugin loading is chosen, fully-qualifiedPluginProviderclass name is used as the service type. And required plugin configuration in this case can be set up viaIgniteConfiguration.setPluginConfigurations(PluginConfiguration...).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Stringcopyright()CachePluginProvidercreateCacheProvider(CachePluginContext ctx)Creates cache plugin provider.<T> TcreateComponent(PluginContext ctx, Class<T> cls)Creates Ignite component.voidinitExtensions(PluginContext ctx, ExtensionRegistry registry)Registers extensions.Stringname()voidonIgniteStart()Callback that notifies that Ignite has successfully started, including all internal components.voidonIgniteStop(boolean cancel)Callback to notify that Ignite is about to stop.<T extends IgnitePlugin>
Tplugin()@Nullable SerializableprovideDiscoveryData(UUID nodeId)Gets plugin discovery data object that will be sent to the new node during discovery process.voidreceiveDiscoveryData(UUID nodeId, Serializable data)Receives plugin discovery data object from remote nodes (called on new node during discovery process).voidstart(PluginContext ctx)Starts grid component.voidstop(boolean cancel)Stops grid component.voidvalidateNewNode(ClusterNode node)Deprecated.UsevalidateNewNode(ClusterNode, Serializable)instead.default voidvalidateNewNode(ClusterNode node, Serializable data)Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.Stringversion()
-
-
-
Method Detail
-
name
String name()
- Returns:
- Plugin name.
-
version
String version()
- Returns:
- Plugin version.
-
copyright
String copyright()
- Returns:
- Copyright.
-
plugin
<T extends IgnitePlugin> T plugin()
- Type Parameters:
T- Type of the plugin.- Returns:
- Plugin API.
-
initExtensions
void initExtensions(PluginContext ctx, ExtensionRegistry registry) throws IgniteCheckedException
Registers extensions.- Parameters:
ctx- Plugin context.registry- Extension registry.- Throws:
IgniteCheckedException
-
createComponent
@Nullable <T> T createComponent(PluginContext ctx, Class<T> cls)
Creates Ignite component.- Type Parameters:
T- Ignite component type.- Parameters:
ctx- Plugin context.cls- Ignite component class.- Returns:
- Ignite component or
nullif component is not supported.
-
createCacheProvider
CachePluginProvider createCacheProvider(CachePluginContext ctx)
Creates cache plugin provider.- Parameters:
ctx- Plugin context.- Returns:
- Cache plugin provider class.
-
start
void start(PluginContext ctx) throws IgniteCheckedException
Starts grid component.- Parameters:
ctx- Plugin context.- Throws:
IgniteCheckedException- Throws in case of any errors.
-
stop
void stop(boolean cancel) throws IgniteCheckedException
Stops grid component.- Parameters:
cancel- Iftrue, then all ongoing tasks or jobs for relevant components need to be cancelled.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
onIgniteStart
void onIgniteStart() throws IgniteCheckedExceptionCallback that notifies that Ignite has successfully started, including all internal components.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
onIgniteStop
void onIgniteStop(boolean cancel)
Callback to notify that Ignite is about to stop.- Parameters:
cancel- Flag indicating whether jobs should be canceled.
-
provideDiscoveryData
@Nullable @Nullable Serializable provideDiscoveryData(UUID nodeId)
Gets plugin discovery data object that will be sent to the new node during discovery process.- Parameters:
nodeId- ID of new node that joins topology.- Returns:
- Discovery data object or
nullif there is nothing to send for this component.
-
receiveDiscoveryData
void receiveDiscoveryData(UUID nodeId, Serializable data)
Receives plugin discovery data object from remote nodes (called on new node during discovery process). This data is provided byprovideDiscoveryData(UUID)method on the other nodes.- Parameters:
nodeId- Remote node ID.data- Discovery data object ornullif nothing was sent for this component.
-
validateNewNode
@Deprecated void validateNewNode(ClusterNode node) throws PluginValidationException
Deprecated.UsevalidateNewNode(ClusterNode, Serializable)instead.Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.- Parameters:
node- Joining node.- Throws:
PluginValidationException- If cluster-wide plugin validation failed.
-
validateNewNode
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.- Parameters:
node- Joining node.data- Discovery data object ornullif nothing was sent for this component.- Throws:
PluginValidationException- If cluster-wide plugin validation failed.
-
-