org.apache.ignite.internal.managers.communication

## Class GridIoManager

- java.lang.Object
- - org.apache.ignite.internal.managers.GridManagerAdapter<CommunicationSpi<Serializable>>
  - - org.apache.ignite.internal.managers.communication.GridIoManager

All Implemented Interfaces:
  GridComponent, GridManager

    public class GridIoManager
    extends GridManagerAdapter<CommunicationSpi<Serializable>>

Grid communication manager.

### Nested Class Summary

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

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

Fields
`static int` `MAX_CLOSED_TOPICS` Max closed topics to store.

### Fields inherited from class org.apache.ignite.internal.managers.GridManagerAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridIoManager(GridKernalContext ctx)`

### Method Summary

Methods
`void` `addDisconnectListener(GridDisconnectListener lsnr)`
`void` `addMessageListener(GridTopic topic, GridMessageListener lsnr)`
`void` `addMessageListener(Object topic, GridMessageListener lsnr)`
`void` `addUserMessageListener(Object topic, IgniteBiPredicate<UUID,?> p)`
`MessageFormatter` `formatter()`
`int` `getOutboundMessagesQueueSize()` Gets outbound messages queue size.
`long` `getReceivedBytesCount()` Gets received bytes count.
`int` `getReceivedMessagesCount()` Gets received messages count.
`long` `getSentBytesCount()` Gets sent bytes count.
`int` `getSentMessagesCount()` Gets sent messages count.
`MessageFactory` `messageFactory()`
`void` `onKernalStart0()`
`void` `onKernalStop0(boolean cancel)`
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`boolean` `removeMessageListener(GridTopic topic)`
`boolean` `removeMessageListener(GridTopic topic, GridMessageListener lsnr)`
`boolean` `removeMessageListener(Object topic)`
`boolean` `removeMessageListener(Object topic, GridMessageListener lsnr)`
`void` `removeUserMessageListener(Object topic, IgniteBiPredicate<UUID,?> p)`
`void` `resetMetrics()` Resets metrics for this manager.
`void` `send(ClusterNode node, GridTopic topic, Message msg, GridIoPolicy plc)`
`void` `send(ClusterNode node, Object topic, Message msg, GridIoPolicy plc)`
`void` `send(Collection<? extends ClusterNode> nodes, GridTopic topic, Message msg, GridIoPolicy plc)`
`void` `send(Collection<? extends ClusterNode> nodes, Object topic, Message msg, GridIoPolicy plc)`
`void` `send(UUID nodeId, GridTopic topic, Message msg, GridIoPolicy plc)`
`void` `send(UUID nodeId, Object topic, Message msg, GridIoPolicy plc)`
`void` `sendOrderedMessage(ClusterNode node, Object topic, Message msg, GridIoPolicy plc, long timeout, boolean skipOnTimeout)`
`void` `sendOrderedMessage(Collection<? extends ClusterNode> nodes, Object topic, Message msg, GridIoPolicy plc, long timeout, boolean skipOnTimeout)`
`void` `sendOrderedMessage(UUID nodeId, Object topic, Message msg, GridIoPolicy plc, long timeout, boolean skipOnTimeout)`
`void` `sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg)` Sends a peer deployable user message.
`void` `sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg, Object topic, boolean ordered, long timeout)` Sends a peer deployable user message.
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.

### Methods inherited from class org.apache.ignite.internal.managers.GridManagerAdapter

`assertParameter, collectDiscoveryData, discoveryDataType, enabled, getSpi, getSpi, getSpis, onAfterSpiStart, onBeforeSpiStart, onDiscoveryDataReceived, onKernalStart, onKernalStop, startInfo, startSpi, stopInfo, stopSpi, toString, validateNode`

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

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

### Field Detail

#### MAX_CLOSED_TOPICS

    public static final int MAX_CLOSED_TOPICS

Max closed topics to store.

See Also:
  Constant Field Values

### Constructor Detail

#### GridIoManager

    public GridIoManager(GridKernalContext ctx)

Parameters:
  `ctx` - Grid kernal context.

### Method Detail

#### messageFactory

    public MessageFactory messageFactory()

Returns:
  Message factory.

#### formatter

    public MessageFormatter formatter()

Returns:
  Message writer factory.

#### resetMetrics

    public void resetMetrics()

Resets metrics for this manager.

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### onKernalStart0

    public void onKernalStart0()
                        throws IgniteCheckedException

Overrides:
  `onKernalStart0` in class `GridManagerAdapter<CommunicationSpi<Serializable>>`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    public void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridManagerAdapter<CommunicationSpi<Serializable>>`
Parameters:
  `cancel` - Cancel flag.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

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.

#### send

    public void send(UUID nodeId,
            Object topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `nodeId` - Id of destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### send

    public void send(UUID nodeId,
            GridTopic topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `nodeId` - Id of destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### send

    public void send(ClusterNode node,
            Object topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `node` - Destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### send

    public void send(ClusterNode node,
            GridTopic topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `node` - Destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### sendOrderedMessage

    public void sendOrderedMessage(ClusterNode node,
                          Object topic,
                          Message msg,
                          GridIoPolicy plc,
                          long timeout,
                          boolean skipOnTimeout)
                            throws IgniteCheckedException

Parameters:
  `node` - Destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
  `timeout` - Timeout to keep a message on receiving queue.
  `skipOnTimeout` - Whether message can be skipped on timeout.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### sendOrderedMessage

    public void sendOrderedMessage(UUID nodeId,
                          Object topic,
                          Message msg,
                          GridIoPolicy plc,
                          long timeout,
                          boolean skipOnTimeout)
                            throws IgniteCheckedException

Parameters:
  `nodeId` - Destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
  `timeout` - Timeout to keep a message on receiving queue.
  `skipOnTimeout` - Whether message can be skipped on timeout.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### sendOrderedMessage

    public void sendOrderedMessage(Collection<? extends ClusterNode> nodes,
                          Object topic,
                          Message msg,
                          GridIoPolicy plc,
                          long timeout,
                          boolean skipOnTimeout)
                            throws IgniteCheckedException

Parameters:
  `nodes` - Destination nodes.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
  `timeout` - Timeout to keep a message on receiving queue.
  `skipOnTimeout` - Whether message can be skipped on timeout.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### send

    public void send(Collection<? extends ClusterNode> nodes,
            Object topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `nodes` - Destination nodes.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### send

    public void send(Collection<? extends ClusterNode> nodes,
            GridTopic topic,
            Message msg,
            GridIoPolicy plc)
              throws IgniteCheckedException

Parameters:
  `nodes` - Destination nodes.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - Type of processing.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### sendUserMessage

    public void sendUserMessage(Collection<? extends ClusterNode> nodes,
                       Object msg)
                         throws IgniteCheckedException

Sends a peer deployable user message.

Parameters:
  `nodes` - Destination nodes.
  `msg` - Message to send.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### sendUserMessage

    public void sendUserMessage(Collection<? extends ClusterNode> nodes,
                       Object msg,
                       @Nullable
                       Object topic,
                       boolean ordered,
                       long timeout)
                         throws IgniteCheckedException

Sends a peer deployable user message.

Parameters:
  `nodes` - Destination nodes.
  `msg` - Message to send.
  `topic` - Message topic to use.
  `ordered` - Is message ordered?
  `timeout` - Message timeout in milliseconds for ordered messages.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### addUserMessageListener

    public void addUserMessageListener(@Nullable
                              Object topic,
                              @Nullable
                              IgniteBiPredicate<UUID,?> p)

Parameters:
  `topic` - Topic to subscribe to.
  `p` - Message predicate.

#### removeUserMessageListener

    public void removeUserMessageListener(@Nullable
                                 Object topic,
                                 IgniteBiPredicate<UUID,?> p)

Parameters:
  `topic` - Topic to unsubscribe from.
  `p` - Message predicate.

#### addMessageListener

    public void addMessageListener(GridTopic topic,
                          GridMessageListener lsnr)

Parameters:
  `topic` - Listener's topic.
  `lsnr` - Listener to add.

#### addDisconnectListener

    public void addDisconnectListener(GridDisconnectListener lsnr)

Parameters:
  `lsnr` - Listener to add.

#### addMessageListener

    public void addMessageListener(Object topic,
                          GridMessageListener lsnr)

Parameters:
  `topic` - Listener's topic.
  `lsnr` - Listener to add.

#### removeMessageListener

    public boolean removeMessageListener(GridTopic topic)

Parameters:
  `topic` - Message topic.
Returns:
  Whether or not listener was indeed removed.

#### removeMessageListener

    public boolean removeMessageListener(Object topic)

Parameters:
  `topic` - Message topic.
Returns:
  Whether or not listener was indeed removed.

#### removeMessageListener

    public boolean removeMessageListener(GridTopic topic,
                                @Nullable
                                GridMessageListener lsnr)

Parameters:
  `topic` - Listener's topic.
  `lsnr` - Listener to remove.
Returns:
  Whether or not the lsnr was removed.

#### removeMessageListener

    public boolean removeMessageListener(Object topic,
                                @Nullable
                                GridMessageListener lsnr)

Parameters:
  `topic` - Listener's topic.
  `lsnr` - Listener to remove.
Returns:
  Whether or not the lsnr was removed.

#### getSentMessagesCount

    public int getSentMessagesCount()

Gets sent messages count.

Returns:
  Sent messages count.

#### getSentBytesCount

    public long getSentBytesCount()

Gets sent bytes count.

Returns:
  Sent bytes count.

#### getReceivedMessagesCount

    public int getReceivedMessagesCount()

Gets received messages count.

Returns:
  Received messages count.

#### getReceivedBytesCount

    public long getReceivedBytesCount()

Gets received bytes count.

Returns:
  Received bytes count.

#### getOutboundMessagesQueueSize

    public int getOutboundMessagesQueueSize()

Gets outbound messages queue size.

Returns:
  Outbound messages queue size.

#### 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`
Overrides:
  `printMemoryStats` in class `GridManagerAdapter<CommunicationSpi<Serializable>>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015