Package org.elasticsearch.transport
Class CloseableConnection
java.lang.Object
org.elasticsearch.transport.CloseableConnection
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Transport.Connection
- Direct Known Subclasses:
TcpTransport.NodeChannels
public abstract class CloseableConnection extends java.lang.Object implements Transport.Connection
Abstract Transport.Connection that provides common close logic.
-
Constructor Summary
Constructors Constructor Description CloseableConnection() -
Method Summary
Modifier and Type Method Description voidaddCloseListener(ActionListener<java.lang.Void> listener)The listener'sActionListener.onResponse(Object)method will be called when this connection is closed.voidclose()booleanisClosed()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.transport.Transport.Connection
getCacheKey, getNode, getVersion, sendRequest
-
Constructor Details
-
CloseableConnection
public CloseableConnection()
-
-
Method Details
-
addCloseListener
Description copied from interface:Transport.ConnectionThe 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:
addCloseListenerin interfaceTransport.Connection- Parameters:
listener- to be called
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceTransport.Connection
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceTransport.Connection
-