Package org.elasticsearch.nio
Class BytesChannelContext
java.lang.Object
org.elasticsearch.nio.ChannelContext<SocketChannel>
org.elasticsearch.nio.SocketChannelContext
org.elasticsearch.nio.BytesChannelContext
-
Field Summary
Fields inherited from class org.elasticsearch.nio.SocketChannelContext
channel, channelBuffer, isClosingFields inherited from class org.elasticsearch.nio.ChannelContext
rawChannel -
Constructor Summary
ConstructorsConstructorDescriptionBytesChannelContext(NioSocketChannel channel, NioSelector selector, Config.Socket socketConfig, Consumer<Exception> exceptionHandler, NioChannelHandler handler, InboundChannelBuffer channelBuffer) -
Method Summary
Modifier and TypeMethodDescriptionvoidSchedules a channel to be closed by the selector event loop with which it is registered.voidintread()booleanThis method indicates if a selector should close this channel.Methods inherited from class org.elasticsearch.nio.SocketChannelContext
addConnectListener, channelActive, closeFromSelector, closeNow, connect, currentFlushOperationComplete, currentFlushOperationFailed, flushToChannel, getChannel, getPendingFlush, getSelector, handleReadBytes, isConnectComplete, queueWriteOperation, readFromChannel, readyForFlush, register, sendMessage, setCloseNowMethods inherited from class org.elasticsearch.nio.ChannelContext
addCloseListener, getSelectionKey, handleException, isOpen, setSelectionKey
-
Constructor Details
-
BytesChannelContext
public BytesChannelContext(NioSocketChannel channel, NioSelector selector, Config.Socket socketConfig, Consumer<Exception> exceptionHandler, NioChannelHandler handler, InboundChannelBuffer channelBuffer)
-
-
Method Details
-
read
- Specified by:
readin classSocketChannelContext- Throws:
IOException
-
flushChannel
- Specified by:
flushChannelin classSocketChannelContext- Throws:
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<SocketChannel>
-
selectorShouldClose
public boolean selectorShouldClose()Description copied from class:SocketChannelContextThis method indicates if a selector should close this channel.- Specified by:
selectorShouldClosein classSocketChannelContext- Returns:
- a boolean indicating if the selector should close
-