Package org.elasticsearch.nio
Class ServerChannelContext
- java.lang.Object
-
- org.elasticsearch.nio.ChannelContext<java.nio.channels.ServerSocketChannel>
-
- org.elasticsearch.nio.ServerChannelContext
-
public class ServerChannelContext extends ChannelContext<java.nio.channels.ServerSocketChannel>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.nio.ChannelContext
rawChannel
-
-
Constructor Summary
Constructors Constructor Description ServerChannelContext(NioServerSocketChannel channel, ChannelFactory<?,?> channelFactory, NioSelector selector, java.util.function.Consumer<NioSocketChannel> acceptor, java.util.function.Consumer<java.lang.Exception> exceptionHandler)
-
Method Summary
Modifier and Type Method Description voidacceptChannels(java.util.function.Supplier<NioSelector> selectorSupplier)voidcloseChannel()Schedules a channel to be closed by the selector event loop with which it is registered.NioServerSocketChannelgetChannel()NioSelectorgetSelector()-
Methods inherited from class org.elasticsearch.nio.ChannelContext
addCloseListener, closeFromSelector, handleException, isOpen, register, setSelectionKey
-
-
-
-
Constructor Detail
-
ServerChannelContext
public ServerChannelContext(NioServerSocketChannel channel, ChannelFactory<?,?> channelFactory, NioSelector selector, java.util.function.Consumer<NioSocketChannel> acceptor, java.util.function.Consumer<java.lang.Exception> exceptionHandler)
-
-
Method Detail
-
acceptChannels
public void acceptChannels(java.util.function.Supplier<NioSelector> selectorSupplier) throws java.io.IOException
- Throws:
java.io.IOException
-
closeChannel
public void closeChannel()
Description copied from class:ChannelContextSchedules a channel to be closed by the selector event loop with which it is registered. If the channel is open and the state can be transitioned to closed, the close operation will be scheduled with the event loop. Depending on the underlying protocol of the channel, a close operation might simply close the socket channel or may involve reading and writing messages.- Specified by:
closeChannelin classChannelContext<java.nio.channels.ServerSocketChannel>
-
getSelector
public NioSelector getSelector()
- Specified by:
getSelectorin classChannelContext<java.nio.channels.ServerSocketChannel>
-
getChannel
public NioServerSocketChannel getChannel()
- Specified by:
getChannelin classChannelContext<java.nio.channels.ServerSocketChannel>
-
-