ChannelConfig implementation.
| Modifier and Type | Field and Description |
|---|---|
| private volatile ByteBufAllocator | |
| private volatile boolean | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| protected final Channel | |
| private volatile int | |
| private static final int | |
| private static final MessageSizeEstimator | |
| private volatile int | |
| private volatile MessageSizeEstimator | |
| private volatile boolean | |
| private volatile RecvByteBufAllocator | |
| private static final AtomicReferenceFieldUpdater | |
| private volatile WriteBufferWaterMark | |
| private volatile int |
| Access | Constructor and Description |
|---|---|
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | autoReadCleared()
Is called once |
| public ByteBufAllocator | getAllocator()
Implements io. ByteBufAllocator which is used for the channel
to allocate buffers.
|
| public int | getConnectTimeoutMillis()
Implements io. |
| public int | |
| public int | |
| public MessageSizeEstimator | getMessageSizeEstimator()
Implements io. MessageSizeEstimator which is used for the channel
to detect the size of a message.
|
| public <T> T | getOption(ChannelOption<T> option)
Implements io. ChannelOption
|
| public Map | |
| protected Map | |
| private boolean | |
| public <T extends RecvByteBufAllocator> T | getRecvByteBufAllocator()
Implements io. RecvByteBufAllocator which is used for the channel to allocate receive buffers.
|
| public int | getWriteBufferHighWaterMark()
Implements io. |
| public int | getWriteBufferLowWaterMark()
Implements io. |
| public WriteBufferWaterMark | getWriteBufferWaterMark()
Implements io. WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
|
| public int | getWriteSpinCount()
Implements io. WritableByteChannel#write(ByteBuffer) returns a non-zero value.
|
| public boolean | isAutoClose()
Implements io. true if and only if the Channel will be closed automatically and immediately on
write failure.
|
| public boolean | isAutoRead()
Implements io. true if and only if ChannelHandlerContext#read() will be invoked automatically so that
a user application doesn't need to call it at all.
|
| public ChannelConfig | setAllocator(ByteBufAllocator allocator)
Implements io. ByteBufAllocator which is used for the channel
to allocate buffers.
|
| public ChannelConfig | setAutoClose(boolean autoClose)
Implements io. Channel should be closed automatically and immediately on write failure.
|
| public ChannelConfig | setAutoRead(boolean autoRead)
Implements io. ChannelHandlerContext#read() will be invoked automatically so that a user application doesn't
need to call it at all.
|
| public ChannelConfig | setConnectTimeoutMillis(int
the connect timeout in milliseconds.
connectTimeoutMillis)0 to disable.Implements io. |
| public ChannelConfig | setMaxMessagesPerRead(int maxMessagesPerRead)
Implements io.
Deprecated
|
| public ChannelConfig | setMaxMessagesPerWrite(int maxMessagesPerWrite)
Set the maximum number of message to write per eventloop run. |
| public ChannelConfig | setMessageSizeEstimator(MessageSizeEstimator estimator)
Implements io. MessageSizeEstimator which is used for the channel
to detect the size of a message.
|
| public <T> boolean | setOption(ChannelOption<T> option, T value)
Implements io. |
| public boolean | setOptions(Map<ChannelOption<?>, ?> options)
Implements io. Map.
|
| private ChannelConfig | |
| public ChannelConfig | setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Implements io. RecvByteBufAllocator which is used for the channel to allocate receive buffers.
|
| private void | setRecvByteBufAllocator(RecvByteBufAllocator
the allocator to set. allocator, ChannelMetadata Used to set the metadata)ChannelMetadata#defaultMaxMessagesPerRead() if allocator
is of type MaxMessagesRecvByteBufAllocator.Set the |
| public ChannelConfig | setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Implements io. Sets the high water mark of the write buffer. |
| public ChannelConfig | setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Implements io. Sets the low water mark of the write buffer. |
| public ChannelConfig | setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Implements io. WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
|
| public ChannelConfig | setWriteSpinCount(int writeSpinCount)
Implements io. WritableByteChannel#write(ByteBuffer) returns a non-zero value.
|
| protected <T> void |
| allocator | back to summary |
|---|---|
| private volatile ByteBufAllocator allocator | |
| autoClose | back to summary |
|---|---|
| private volatile boolean autoClose | |
| autoRead | back to summary |
|---|---|
private volatile int autoRead
| |
| AUTOREAD_UPDATER | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<DefaultChannelConfig> AUTOREAD_UPDATER | |
| channel | back to summary |
|---|---|
| protected final Channel channel | |
| connectTimeoutMillis | back to summary |
|---|---|
| private volatile int connectTimeoutMillis | |
| DEFAULT_CONNECT_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_CONNECT_TIMEOUT | |
| DEFAULT_MSG_SIZE_ESTIMATOR | back to summary |
|---|---|
| private static final MessageSizeEstimator DEFAULT_MSG_SIZE_ESTIMATOR | |
| maxMessagesPerWrite | back to summary |
|---|---|
| private volatile int maxMessagesPerWrite | |
| msgSizeEstimator | back to summary |
|---|---|
| private volatile MessageSizeEstimator msgSizeEstimator | |
| pinEventExecutor | back to summary |
|---|---|
| private volatile boolean pinEventExecutor | |
| rcvBufAllocator | back to summary |
|---|---|
| private volatile RecvByteBufAllocator rcvBufAllocator | |
| WATERMARK_UPDATER | back to summary |
|---|---|
| private static final AtomicReferenceFieldUpdater<DefaultChannelConfig, WriteBufferWaterMark> WATERMARK_UPDATER | |
| writeBufferWaterMark | back to summary |
|---|---|
| private volatile WriteBufferWaterMark writeBufferWaterMark | |
| writeSpinCount | back to summary |
|---|---|
| private volatile int writeSpinCount | |
| DefaultChannelConfig | back to summary |
|---|---|
| public DefaultChannelConfig(Channel channel) | |
| DefaultChannelConfig | back to summary |
|---|---|
| protected DefaultChannelConfig(Channel channel, RecvByteBufAllocator allocator) | |
| autoReadCleared | back to summary |
|---|---|
| protected void autoReadCleared() Is called once | |
| getAllocator | back to summary |
|---|---|
| public ByteBufAllocator getAllocator() Implements io. Doc from io. Returns
| |
| getConnectTimeoutMillis | back to summary |
|---|---|
| public int getConnectTimeoutMillis() Implements io. Doc from io. Returns the connect timeout of the channel in milliseconds. If the
| |
| getMaxMessagesPerRead | back to summary |
|---|---|
| public int getMaxMessagesPerRead() Implements io. Deprecated
| |
| getMaxMessagesPerWrite | back to summary |
|---|---|
| public int getMaxMessagesPerWrite() Get the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages. | |
| getMessageSizeEstimator | back to summary |
|---|---|
| public MessageSizeEstimator getMessageSizeEstimator() Implements io. Doc from io. Returns
| |
| getOption | back to summary |
|---|---|
| public <T> T getOption(ChannelOption<T> option) Implements io. Doc from io. Return the value of the given
| |
| getOptions | back to summary |
|---|---|
| public Map Implements io. Doc from io. Return all set
| |
| getOptions | back to summary |
|---|---|
| protected Map | |
| getPinEventExecutorPerGroup | back to summary |
|---|---|
| private boolean getPinEventExecutorPerGroup() | |
| getRecvByteBufAllocator | back to summary |
|---|---|
| public <T extends RecvByteBufAllocator> T getRecvByteBufAllocator() Implements io. Doc from io. Returns
| |
| getWriteBufferHighWaterMark | back to summary |
|---|---|
| public int getWriteBufferHighWaterMark() Implements io. Doc from io. Returns the high water mark of the write buffer. If the number of bytes
queued in the write buffer exceeds this value,
| |
| getWriteBufferLowWaterMark | back to summary |
|---|---|
| public int getWriteBufferLowWaterMark() Implements io. Doc from io. Returns the low water mark of the write buffer. Once the number of bytes
queued in the write buffer exceeded the
high water mark and then
dropped down below this value,
| |
| getWriteBufferWaterMark | back to summary |
|---|---|
| public WriteBufferWaterMark getWriteBufferWaterMark() Implements io. Doc from io. Returns the
| |
| getWriteSpinCount | back to summary |
|---|---|
| public int getWriteSpinCount() Implements io. Doc from io. Returns the maximum loop count for a write operation until
| |
| isAutoClose | back to summary |
|---|---|
| public boolean isAutoClose() Implements io. Doc from io. Returns
| |
| isAutoRead | back to summary |
|---|---|
| public boolean isAutoRead() Implements io. Doc from io. Returns
| |
| setAllocator | back to summary |
|---|---|
| public ChannelConfig setAllocator(ByteBufAllocator allocator) Implements io. Doc from io. Set the
| |
| setAutoClose | back to summary |
|---|---|
| public ChannelConfig setAutoClose(boolean autoClose) Implements io. Doc from io. Sets whether the
| |
| setAutoRead | back to summary |
|---|---|
| public ChannelConfig setAutoRead(boolean autoRead) Implements io. Doc from io. Sets if
| |
| setConnectTimeoutMillis | back to summary |
|---|---|
| public ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis) Implements io. Doc from io. Sets the connect timeout of the channel in milliseconds. If the
| |
| setMaxMessagesPerRead | back to summary |
|---|---|
| public ChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead) Implements io. Deprecated
| |
| setMaxMessagesPerWrite | back to summary |
|---|---|
| public ChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite) Set the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages. | |
| setMessageSizeEstimator | back to summary |
|---|---|
| public ChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) Implements io. Doc from io. Set the
| |
| setOption | back to summary |
|---|---|
| public <T> boolean setOption(ChannelOption<T> option, T value) Implements io. Doc from io. Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:
public boolean setOption(ChannelOption<T> option, T value) {
if (super.setOption(option, value)) {
return true;
}
if (option.equals(additionalOption)) {
....
return true;
}
return false;
}
| |
| setOptions | back to summary |
|---|---|
| public boolean setOptions(Map<ChannelOption<?>, ?> options) Implements io. Doc from io. Sets the configuration properties from the specified
| |
| setPinEventExecutorPerGroup | back to summary |
|---|---|
| private ChannelConfig setPinEventExecutorPerGroup(boolean pinEventExecutor) | |
| setRecvByteBufAllocator | back to summary |
|---|---|
| public ChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) Implements io. Doc from io. Set the
| |
| setRecvByteBufAllocator | back to summary |
|---|---|
| private void setRecvByteBufAllocator(RecvByteBufAllocator allocator, ChannelMetadata metadata) Set the
| |
| setWriteBufferHighWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) Implements io. Doc from io.
Sets the high water mark of the write buffer. If the number of bytes
queued in the write buffer exceeds this value,
| |
| setWriteBufferLowWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) Implements io. Doc from io.
Sets the low water mark of the write buffer. Once the number of bytes
queued in the write buffer exceeded the
high water mark and then
dropped down below this value,
| |
| setWriteBufferWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) Implements io. Doc from io. Set the
| |
| setWriteSpinCount | back to summary |
|---|---|
| public ChannelConfig setWriteSpinCount(int writeSpinCount) Implements io. Doc from io. Sets the maximum loop count for a write operation until
| |
| validate | back to summary |
|---|---|
| protected <T> void validate(ChannelOption<T> option, T value) | |