Class GridAbstractCommunicationClient
- java.lang.Object
-
- org.apache.ignite.internal.util.nio.GridAbstractCommunicationClient
-
- All Implemented Interfaces:
GridCommunicationClient
- Direct Known Subclasses:
GridTcpNioCommunicationClient
public abstract class GridAbstractCommunicationClient extends Object implements GridCommunicationClient
Implements basic lifecycle for communication clients.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridAbstractCommunicationClient(int connIdx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasync()booleanclose()booleanclosed()intconnectionIndex()voidforceClose()Forces client close.longgetIdleTime()Gets idle time of this client.protected voidmarkUsed()Updates used time.voidrelease()Releases this client by decreasing reservations.booleanreserve()StringtoString()-
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
-
-
-
-
Method Detail
-
connectionIndex
public int connectionIndex()
- Specified by:
connectionIndexin interfaceGridCommunicationClient- Returns:
- Connection index.
-
close
public boolean close()
- Specified by:
closein interfaceGridCommunicationClient- Returns:
Trueif client has been closed by this call,falseif failed to close client (due to concurrent reservation or concurrent close).
-
forceClose
public void forceClose()
Forces client close.- Specified by:
forceClosein interfaceGridCommunicationClient
-
closed
public boolean closed()
- Specified by:
closedin interfaceGridCommunicationClient- Returns:
Trueif client is closed;
-
reserve
public boolean reserve()
- Specified by:
reservein interfaceGridCommunicationClient- Returns:
Trueif client was reserved,falseotherwise.
-
release
public void release()
Releases this client by decreasing reservations.- Specified by:
releasein interfaceGridCommunicationClient
-
getIdleTime
public long getIdleTime()
Gets idle time of this client.- Specified by:
getIdleTimein interfaceGridCommunicationClient- Returns:
- Idle time of this client.
-
markUsed
protected void markUsed()
Updates used time.
-
async
public boolean async()
- Specified by:
asyncin interfaceGridCommunicationClient- Returns:
Trueif send is asynchronous.
-
-