AbstractChannel Class — netty Architecture
Architecture documentation for the AbstractChannel class in AbstractChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 5db74d02_3876_98d6_bb77_e445d8c46783["AbstractChannel"] 2f45d36a_a64d_2e11_9b5d_198acbea865d["AbstractChannel.java"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|defined in| 2f45d36a_a64d_2e11_9b5d_198acbea865d ba675306_26b9_d280_e15f_ce00430a7bc3["AbstractChannel()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| ba675306_26b9_d280_e15f_ce00430a7bc3 02aaa129_9c7e_3f67_27c0_81ab270272f7["maxMessagesPerWrite()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 02aaa129_9c7e_3f67_27c0_81ab270272f7 7f452589_e749_e15d_45c0_4fbc1091c80e["ChannelId()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 7f452589_e749_e15d_45c0_4fbc1091c80e 69138744_fc62_60ad_31e9_2c72be2917c9["DefaultChannelPipeline()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 69138744_fc62_60ad_31e9_2c72be2917c9 16cf983a_6198_5078_62ff_74cb4fe7ce67["Channel()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 16cf983a_6198_5078_62ff_74cb4fe7ce67 a284abee_280b_55d4_1056_cd1b46c69e10["ChannelPipeline()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| a284abee_280b_55d4_1056_cd1b46c69e10 c4f856db_ed9d_450f_3c7d_f97ee8df83e9["EventLoop()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| c4f856db_ed9d_450f_3c7d_f97ee8df83e9 f85a09d4_00c7_0f8f_c089_f292e8f10704["SocketAddress()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| f85a09d4_00c7_0f8f_c089_f292e8f10704 7c2a847e_9ef0_2976_e58a_966fada7e494["invalidateLocalAddress()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 7c2a847e_9ef0_2976_e58a_966fada7e494 801eb5ff_0a0a_dc96_bf6d_b663d5f4bf12["invalidateRemoteAddress()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 801eb5ff_0a0a_dc96_bf6d_b663d5f4bf12 f8eefee7_95b2_a426_9c6e_d60d6c0a3f39["isRegistered()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| f8eefee7_95b2_a426_9c6e_d60d6c0a3f39 b21799d8_8612_c0e8_1cac_85ab5718ffae["ChannelFuture()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| b21799d8_8612_c0e8_1cac_85ab5718ffae 7dfeab45_41dd_149a_07b7_d85bcc736fc8["Unsafe()"] 5db74d02_3876_98d6_bb77_e445d8c46783 -->|method| 7dfeab45_41dd_149a_07b7_d85bcc736fc8
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/AbstractChannel.java lines 41–1095
public abstract class AbstractChannel extends DefaultAttributeMap implements Channel {
private static final InternalLogger logger = InternalLoggerFactory.getInstance(AbstractChannel.class);
private final Channel parent;
private final ChannelId id;
private final Unsafe unsafe;
private final DefaultChannelPipeline pipeline;
private final VoidChannelPromise unsafeVoidPromise = new VoidChannelPromise(this, false);
private final CloseFuture closeFuture = new CloseFuture(this);
private volatile SocketAddress localAddress;
private volatile SocketAddress remoteAddress;
private volatile EventLoop eventLoop;
private volatile boolean registered;
private boolean closeInitiated;
private Throwable initialCloseCause;
/** Cache for the string representation of this channel */
private boolean strValActive;
private String strVal;
/**
* Creates a new instance.
*
* @param parent
* the parent of this channel. {@code null} if there's no parent.
*/
protected AbstractChannel(Channel parent) {
this.parent = parent;
id = newId();
unsafe = newUnsafe();
pipeline = newChannelPipeline();
}
/**
* Creates a new instance.
*
* @param parent
* the parent of this channel. {@code null} if there's no parent.
*/
protected AbstractChannel(Channel parent, ChannelId id) {
this.parent = parent;
this.id = id;
unsafe = newUnsafe();
pipeline = newChannelPipeline();
}
protected final int maxMessagesPerWrite() {
ChannelConfig config = config();
if (config instanceof DefaultChannelConfig) {
return ((DefaultChannelConfig) config).getMaxMessagesPerWrite();
}
Integer value = config.getOption(ChannelOption.MAX_MESSAGES_PER_WRITE);
if (value == null) {
return Integer.MAX_VALUE;
}
return value;
}
@Override
public final ChannelId id() {
return id;
}
/**
* Returns a new {@link DefaultChannelId} instance. Subclasses may override this method to assign custom
* {@link ChannelId}s to {@link Channel}s that use the {@link AbstractChannel#AbstractChannel(Channel)} constructor.
*/
protected ChannelId newId() {
return DefaultChannelId.newInstance();
}
/**
* Returns a new {@link DefaultChannelPipeline} instance.
*/
protected DefaultChannelPipeline newChannelPipeline() {
return new DefaultChannelPipeline(this);
}
@Override
Source
Frequently Asked Questions
What is the AbstractChannel class?
AbstractChannel is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/AbstractChannel.java.
Where is AbstractChannel defined?
AbstractChannel is defined in transport/src/main/java/io/netty/channel/AbstractChannel.java at line 41.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free