Class Netty4TcpChannel
java.lang.Object
org.elasticsearch.transport.netty4.Netty4TcpChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,CloseableChannel,TcpChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.transport.TcpChannel
TcpChannel.ChannelStats -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseListener(ActionListener<Void> listener) voidaddConnectListener(ActionListener<Void> listener) static voidaddListener(io.netty.channel.ChannelFuture channelFuture, ListenableFuture<Void> listener) Adds a listener that completes the givenListenableFutureto the givenChannelFuture.static io.netty.channel.ChannelPromiseaddPromise(ActionListener<Void> listener, io.netty.channel.Channel channel) Creates aChannelPromisefor the givenChanneland adds a listener that invokes the givenActionListeneron its completion.voidclose()io.netty.channel.ChannelbooleanisOpen()booleanvoidsendMessage(BytesReference reference, ActionListener<Void> listener) toString()
-
Method Details
-
addListener
public static void addListener(io.netty.channel.ChannelFuture channelFuture, ListenableFuture<Void> listener) Adds a listener that completes the givenListenableFutureto the givenChannelFuture.- Parameters:
channelFuture- Channel futurelistener- Listener to complete
-
addPromise
public static io.netty.channel.ChannelPromise addPromise(ActionListener<Void> listener, io.netty.channel.Channel channel) Creates aChannelPromisefor the givenChanneland adds a listener that invokes the givenActionListeneron its completion.- Parameters:
listener- lister to invokechannel- channel- Returns:
- write promise
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableChannel
-
isServerChannel
public boolean isServerChannel()- Specified by:
isServerChannelin interfaceTcpChannel
-
getProfile
- Specified by:
getProfilein interfaceTcpChannel
-
addCloseListener
- Specified by:
addCloseListenerin interfaceCloseableChannel
-
addConnectListener
- Specified by:
addConnectListenerin interfaceTcpChannel
-
getChannelStats
- Specified by:
getChannelStatsin interfaceTcpChannel
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceCloseableChannel
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceTcpChannel
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceTcpChannel
-
sendMessage
- Specified by:
sendMessagein interfaceTcpChannel
-
getNettyChannel
public io.netty.channel.Channel getNettyChannel() -
toString
-