org.apache.ignite.internal.processors.port

## Class GridPortProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.port.GridPortProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridPortProcessor
    extends GridProcessorAdapter

Registers and deregisters all ports used by SPI and Manager.

### Nested Class Summary

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

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridPortProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`void` `addPortListener(GridPortListener lsnr)` Add listener.
`void` `deregisterPort(int port, IgnitePortProtocol proto, Class cls)` Deregisters port used by passed class.
`void` `deregisterPorts(Class cls)` Deregisters all ports used by passed class.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`Collection<GridPortRecord>` `records()` Returns unmodifiable collections of records.
`void` `registerPort(int port, IgnitePortProtocol proto, Class cls)` Registers port using by passed class.
`void` `removePortListener(GridPortListener lsnr)` Remove listener.
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, onKernalStart, onKernalStop, toString, validateNode`

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

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

### Constructor Detail

#### GridPortProcessor

    public GridPortProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`
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`
Overrides:
  `stop` in class `GridProcessorAdapter`
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.

#### registerPort

    public void registerPort(int port,
                    IgnitePortProtocol proto,
                    Class cls)

Registers port using by passed class.

Parameters:
  `port` - Port.
  `proto` - Protocol.
  `cls` - Class.

#### deregisterPorts

    public void deregisterPorts(Class cls)

Deregisters all ports used by passed class.

Parameters:
  `cls` - Class.

#### deregisterPort

    public void deregisterPort(int port,
                      IgnitePortProtocol proto,
                      Class cls)

Deregisters port used by passed class.

Parameters:
  `port` - Port.
  `proto` - Protocol.
  `cls` - Class.

#### records

    public Collection<GridPortRecord> records()

Returns unmodifiable collections of records.

Returns:
  Unmodifiable collections of records

#### addPortListener

    public void addPortListener(GridPortListener lsnr)

Add listener.

Parameters:
  `lsnr` - Listener.

#### removePortListener

    public void removePortListener(GridPortListener lsnr)

Remove listener.

Parameters:
  `lsnr` - Listener.

#### 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 `GridProcessorAdapter`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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