DefaultChannelConfig Class — netty Architecture
Architecture documentation for the DefaultChannelConfig class in DefaultChannelConfig.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 13466572_b18b_f364_a7fa_7c3db65248c3["DefaultChannelConfig"] 9583faa2_2823_af41_c2f4_8b3e5f581fc5["DefaultChannelConfig.java"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|defined in| 9583faa2_2823_af41_c2f4_8b3e5f581fc5 037d20be_c6e7_606e_2873_4e6d5ff2f290["DefaultChannelConfig()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 037d20be_c6e7_606e_2873_4e6d5ff2f290 028c133e_711e_b6fc_4dc3_4b4cb9f0f6bd["getOptions()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 028c133e_711e_b6fc_4dc3_4b4cb9f0f6bd 057cc3a5_5472_cc95_c16d_a08e1f45df6f["setOptions()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 057cc3a5_5472_cc95_c16d_a08e1f45df6f a6209262_552e_c68f_af6c_a3ac31780733["T()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| a6209262_552e_c68f_af6c_a3ac31780733 7ae339e5_a35c_632e_1923_5c9f3c4a5c62["setOption()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 7ae339e5_a35c_632e_1923_5c9f3c4a5c62 9f66c7de_a793_537e_1242_b1655012d02f["validate()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 9f66c7de_a793_537e_1242_b1655012d02f eddaf1d9_175b_2ec5_004c_4914ff7f590a["getConnectTimeoutMillis()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| eddaf1d9_175b_2ec5_004c_4914ff7f590a c5fb1a22_db30_b294_2d12_c5f44facb6a8["ChannelConfig()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| c5fb1a22_db30_b294_2d12_c5f44facb6a8 a3126cbb_7fb0_1e6d_0120_48cca64b8b45["getMaxMessagesPerRead()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| a3126cbb_7fb0_1e6d_0120_48cca64b8b45 7e8d58ef_3777_d959_b45f_53f6735c5835["getMaxMessagesPerWrite()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 7e8d58ef_3777_d959_b45f_53f6735c5835 a5e86f2a_c796_bdf4_946d_98396a9f80c1["getWriteSpinCount()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| a5e86f2a_c796_bdf4_946d_98396a9f80c1 56747f32_b1f1_ae5c_5385_fbbf7610647f["ByteBufAllocator()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| 56747f32_b1f1_ae5c_5385_fbbf7610647f ece07321_dc56_ce1f_2dff_a5313c790382["setRecvByteBufAllocator()"] 13466572_b18b_f364_a7fa_7c3db65248c3 -->|method| ece07321_dc56_ce1f_2dff_a5313c790382
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/DefaultChannelConfig.java lines 47–442
public class DefaultChannelConfig implements ChannelConfig {
private static final MessageSizeEstimator DEFAULT_MSG_SIZE_ESTIMATOR = DefaultMessageSizeEstimator.DEFAULT;
private static final int DEFAULT_CONNECT_TIMEOUT = 30000;
private static final AtomicIntegerFieldUpdater<DefaultChannelConfig> AUTOREAD_UPDATER =
AtomicIntegerFieldUpdater.newUpdater(DefaultChannelConfig.class, "autoRead");
private static final AtomicReferenceFieldUpdater<DefaultChannelConfig, WriteBufferWaterMark> WATERMARK_UPDATER =
AtomicReferenceFieldUpdater.newUpdater(
DefaultChannelConfig.class, WriteBufferWaterMark.class, "writeBufferWaterMark");
protected final Channel channel;
private volatile ByteBufAllocator allocator = ByteBufAllocator.DEFAULT;
private volatile RecvByteBufAllocator rcvBufAllocator;
private volatile MessageSizeEstimator msgSizeEstimator = DEFAULT_MSG_SIZE_ESTIMATOR;
private volatile int connectTimeoutMillis = DEFAULT_CONNECT_TIMEOUT;
private volatile int writeSpinCount = 16;
private volatile int maxMessagesPerWrite = Integer.MAX_VALUE;
@SuppressWarnings("FieldMayBeFinal")
private volatile int autoRead = 1;
private volatile boolean autoClose = true;
private volatile WriteBufferWaterMark writeBufferWaterMark = WriteBufferWaterMark.DEFAULT;
private volatile boolean pinEventExecutor = true;
public DefaultChannelConfig(Channel channel) {
this(channel, new AdaptiveRecvByteBufAllocator());
}
protected DefaultChannelConfig(Channel channel, RecvByteBufAllocator allocator) {
setRecvByteBufAllocator(allocator, channel.metadata());
this.channel = channel;
}
@Override
@SuppressWarnings("deprecation")
public Map<ChannelOption<?>, Object> getOptions() {
return getOptions(
null,
CONNECT_TIMEOUT_MILLIS, MAX_MESSAGES_PER_READ, WRITE_SPIN_COUNT,
ALLOCATOR, AUTO_READ, AUTO_CLOSE, RECVBUF_ALLOCATOR, WRITE_BUFFER_HIGH_WATER_MARK,
WRITE_BUFFER_LOW_WATER_MARK, WRITE_BUFFER_WATER_MARK, MESSAGE_SIZE_ESTIMATOR,
SINGLE_EVENTEXECUTOR_PER_GROUP, MAX_MESSAGES_PER_WRITE);
}
protected Map<ChannelOption<?>, Object> getOptions(
Map<ChannelOption<?>, Object> result, ChannelOption<?>... options) {
if (result == null) {
result = new IdentityHashMap<ChannelOption<?>, Object>();
}
for (ChannelOption<?> o: options) {
result.put(o, getOption(o));
}
return result;
}
@SuppressWarnings("unchecked")
@Override
public boolean setOptions(Map<ChannelOption<?>, ?> options) {
ObjectUtil.checkNotNull(options, "options");
boolean setAllOptions = true;
for (Entry<ChannelOption<?>, ?> e: options.entrySet()) {
if (!setOption((ChannelOption<Object>) e.getKey(), e.getValue())) {
setAllOptions = false;
}
}
return setAllOptions;
}
@Override
@SuppressWarnings({ "unchecked", "deprecation" })
public <T> T getOption(ChannelOption<T> option) {
ObjectUtil.checkNotNull(option, "option");
if (option == CONNECT_TIMEOUT_MILLIS) {
return (T) Integer.valueOf(getConnectTimeoutMillis());
}
Source
Frequently Asked Questions
What is the DefaultChannelConfig class?
DefaultChannelConfig is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/DefaultChannelConfig.java.
Where is DefaultChannelConfig defined?
DefaultChannelConfig is defined in transport/src/main/java/io/netty/channel/DefaultChannelConfig.java at line 47.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free