org.apache.ignite.internal.util.nio

## Class GridAbstractCommunicationClient

- java.lang.Object
- - org.apache.ignite.internal.util.nio.GridAbstractCommunicationClient

All Implemented Interfaces:
  GridCommunicationClient

Direct Known Subclasses:
  GridShmemCommunicationClient, GridTcpNioCommunicationClient

    public abstract class GridAbstractCommunicationClient
    extends Object
    implements GridCommunicationClient

Implements basic lifecycle for communication clients.

### Field Summary

Fields
`protected GridNioMetricsListener` `metricsLsnr` Metrics listener.

### Constructor Summary

Constructors
`protected` `GridAbstractCommunicationClient(GridNioMetricsListener metricsLsnr)`

### Method Summary

Methods
`boolean` `async()`
`boolean` `close()`
`boolean` `closed()`
`void` `forceClose()` Forces client close.
`long` `getIdleTime()` Gets idle time of this client.
`protected void` `markUsed()` Updates used time.
`void` `release()` Releases this client by decreasing reservations.
`boolean` `reserve()`
`boolean` `reserved()`
`String` `toString()`

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

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

### Methods inherited from interface org.apache.ignite.internal.util.nio.GridCommunicationClient

`doHandshake, sendMessage, sendMessage, sendMessage`

### Field Detail

#### metricsLsnr

    protected final GridNioMetricsListener metricsLsnr

Metrics listener.

### Constructor Detail

#### GridAbstractCommunicationClient

    protected GridAbstractCommunicationClient(@Nullable
                                   GridNioMetricsListener metricsLsnr)

Parameters:
  `metricsLsnr` - Metrics listener.

### Method Detail

#### close

    public boolean close()

Specified by:
  `close` in interface `GridCommunicationClient`
Returns:
  `True` if client has been closed by this call, `false` if failed to close client (due to concurrent reservation or concurrent close).

#### forceClose

    public void forceClose()

Forces client close.

Specified by:
  `forceClose` in interface `GridCommunicationClient`

#### closed

    public boolean closed()

Specified by:
  `closed` in interface `GridCommunicationClient`
Returns:
  `True` if client is closed;

#### reserve

    public boolean reserve()

Specified by:
  `reserve` in interface `GridCommunicationClient`
Returns:
  `True` if client was reserved, `false` otherwise.

#### release

    public void release()

Releases this client by decreasing reservations.

Specified by:
  `release` in interface `GridCommunicationClient`

#### reserved

    public boolean reserved()

Specified by:
  `reserved` in interface `GridCommunicationClient`
Returns:
  `True` if client was reserved.

#### getIdleTime

    public long getIdleTime()

Gets idle time of this client.

Specified by:
  `getIdleTime` in interface `GridCommunicationClient`
Returns:
  Idle time of this client.

#### markUsed

    protected void markUsed()

Updates used time.

#### async

    public boolean async()

Specified by:
  `async` in interface `GridCommunicationClient`
Returns:
  `True` if send is asynchronous.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016