org.apache.ignite.internal

## Class GridPluginComponent

- java.lang.Object
- - org.apache.ignite.internal.GridPluginComponent

All Implemented Interfaces:
  GridComponent

    public class GridPluginComponent
    extends Object
    implements GridComponent

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Constructor Summary

Constructors
Constructor and Description
`GridPluginComponent(PluginProvider plugin)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `collectGridNodeData(DiscoveryDataBag dataBag)` Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.
`void` `collectJoiningNodeData(DiscoveryDataBag dataBag)` Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)` Method is called on nodes that are already in grid (not on joining node).
`void` `onKernalStart(boolean active)` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`IgniteInternalFuture<?>` `onReconnected(boolean clusterRestarted)` Client reconnected callback.
`PluginProvider` `plugin()`
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`IgniteNodeValidationResult` `validateNode(ClusterNode node)` Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.
`IgniteNodeValidationResult` `validateNode(ClusterNode node, DiscoveryDataBag.JoiningNodeDiscoveryData discoData)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GridPluginComponent

    public GridPluginComponent(PluginProvider plugin)

Parameters:
  `plugin` - Plugin provider.

### Method Detail

#### plugin

    public PluginProvider plugin()

Returns:
  Plugin instance.

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onKernalStart

    public void onKernalStart(boolean active)
                       throws IgniteCheckedException

Callback that notifies that kernal has successfully started, including all managers and processors.

Specified by:
  `onKernalStart` in interface `GridComponent`
Parameters:
  `active` - Cluster active flag (note: should be used carefully since state can change concurrently).
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)

Client disconnected callback.

Specified by:
  `onDisconnected` in interface `GridComponent`
Parameters:
  `reconnectFut` - Reconnect future.

#### onReconnected

    public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted)

Client reconnected callback.

Specified by:
  `onReconnected` in interface `GridComponent`
Parameters:
  `clusterRestarted` - Cluster restarted flag.
Returns:
  Future to wait before completing reconnect future.

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### discoveryDataType

    @Nullable
    public GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements any of methods `GridComponent.collectJoiningNodeData(DiscoveryDataBag)` or `GridComponent.collectGridNodeData(DiscoveryDataBag)`.

Specified by:
  `discoveryDataType` in interface `GridComponent`
Returns:
  Unique component type for discovery data exchange.

#### collectJoiningNodeData

    public void collectJoiningNodeData(DiscoveryDataBag dataBag)

Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.

Specified by:
  `collectJoiningNodeData` in interface `GridComponent`
Parameters:
  `dataBag` - container object to store discovery data in.

#### collectGridNodeData

    public void collectGridNodeData(DiscoveryDataBag dataBag)

Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.

Specified by:
  `collectGridNodeData` in interface `GridComponent`
Parameters:
  `dataBag` - container object to store discovery data in.

#### onGridDataReceived

    public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)

Receives discovery data object from remote nodes (called on new node during discovery process).

Specified by:
  `onGridDataReceived` in interface `GridComponent`
Parameters:
  `data` - `DiscoveryDataBag.GridDiscoveryData` interface to retrieve discovery data collected on remote nodes (data common for all nodes in grid and specific for each node).

#### onJoiningNodeDataReceived

    public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)

Method is called on nodes that are already in grid (not on joining node). It receives discovery data from joining node.

Specified by:
  `onJoiningNodeDataReceived` in interface `GridComponent`
Parameters:
  `data` - `DiscoveryDataBag.JoiningNodeDiscoveryData` interface to retrieve discovery data of joining node.

#### validateNode

    @Nullable
    public IgniteNodeValidationResult validateNode(ClusterNode node)

Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.

Specified by:
  `validateNode` in interface `GridComponent`
Parameters:
  `node` - Joining node.
Returns:
  Validation result or `null` in case of success.

#### validateNode

    @Nullable
    public IgniteNodeValidationResult validateNode(ClusterNode node,
                                                             DiscoveryDataBag.JoiningNodeDiscoveryData discoData)

Specified by:
  `validateNode` in interface `GridComponent`

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridComponent`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019