Package org.elasticsearch.transport
Class CloseableConnection
org.elasticsearch.transport.CloseableConnection
- All Implemented Interfaces:
,
,
Transport.Connection
- Direct Known Subclasses:
TcpTransport.NodeChannels
Abstract Transport.Connection that provides common close logic.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
> listener)
The listener'sActionListener.onResponse(Object)
method will be called when this connection is closed.void
close()
boolean
isClosed()
Methods inherited from class java.lang.
, , , , , , , , , ,
Methods inherited from interface org.elasticsearch.transport.Transport.Connection
getCacheKey, getNode, getVersion, sendRequest
-
Constructor Details
-
CloseableConnection
public CloseableConnection()
-
-
Method Details
-
addCloseListener
public void addCloseListener(> listener)Description copied from interface:Transport.Connection
The listener'sActionListener.onResponse(Object)
method will be called when this connection is closed. No implementations currently throw an exception during close, soActionListener.onFailure(Exception)
will not be called.- Specified by:
addCloseListener
in interfaceTransport.Connection
- Parameters:
listener
- to be called
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceTransport.Connection
-
close
public void close()- Specified by:
in interface
- Specified by:
in interface
- Specified by:
close
in interfaceTransport.Connection
-