AbstractOioChannel Class — netty Architecture
Architecture documentation for the AbstractOioChannel class in AbstractOioChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD b977d9b6_22e3_b557_72b8_d2d5146d625e["AbstractOioChannel"] 68fab966_c528_5d24_5bc9_959bcb2e6568["AbstractOioChannel.java"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|defined in| 68fab966_c528_5d24_5bc9_959bcb2e6568 7be6dc64_a7fa_34cc_4830_856cc85c020c["AbstractOioChannel()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| 7be6dc64_a7fa_34cc_4830_856cc85c020c 4aa57469_a5e3_d8fc_baef_c7b5cfb962a1["AbstractUnsafe()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| 4aa57469_a5e3_d8fc_baef_c7b5cfb962a1 b6908979_b60f_9ee1_3032_08fa66fde99c["isCompatible()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| b6908979_b60f_9ee1_3032_08fa66fde99c 4ca5a077_b0dc_41f5_8ddb_91dd62fafa97["doConnect()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| 4ca5a077_b0dc_41f5_8ddb_91dd62fafa97 9e8a7203_7ee6_dd0b_9d80_583319a007ce["doBeginRead()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| 9e8a7203_7ee6_dd0b_9d80_583319a007ce d21dc396_4a26_f28e_bd2e_bea1d0a1cad4["doRead()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| d21dc396_4a26_f28e_bd2e_bea1d0a1cad4 c99a6114_afcb_c811_6d0e_029a77f8bd39["isReadPending()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| c99a6114_afcb_c811_6d0e_029a77f8bd39 6ed00785_e28c_e68d_c9e4_d366fb9ccf8f["setReadPending()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| 6ed00785_e28c_e68d_c9e4_d366fb9ccf8f b281b411_175a_7c87_3776_1aebbd95cc2e["clearReadPending()"] b977d9b6_22e3_b557_72b8_d2d5146d625e -->|method| b281b411_175a_7c87_3776_1aebbd95cc2e
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java lines 31–166
@Deprecated
public abstract class AbstractOioChannel extends AbstractChannel {
protected static final int SO_TIMEOUT = 1000;
boolean readPending;
boolean readWhenInactive;
final Runnable readTask = new Runnable() {
@Override
public void run() {
doRead();
}
};
private final Runnable clearReadPendingRunnable = new Runnable() {
@Override
public void run() {
readPending = false;
}
};
/**
* @see AbstractChannel#AbstractChannel(Channel)
*/
protected AbstractOioChannel(Channel parent) {
super(parent);
}
@Override
protected AbstractUnsafe newUnsafe() {
return new DefaultOioUnsafe();
}
private final class DefaultOioUnsafe extends AbstractUnsafe {
@Override
public void connect(
final SocketAddress remoteAddress,
final SocketAddress localAddress, final ChannelPromise promise) {
if (!promise.setUncancellable() || !ensureOpen(promise)) {
return;
}
try {
boolean wasActive = isActive();
doConnect(remoteAddress, localAddress);
// Get the state as trySuccess() may trigger an ChannelFutureListener that will close the Channel.
// We still need to ensure we call fireChannelActive() in this case.
boolean active = isActive();
safeSetSuccess(promise);
if (!wasActive && active) {
pipeline().fireChannelActive();
}
} catch (Throwable t) {
safeSetFailure(promise, annotateConnectException(t, remoteAddress));
closeIfClosed();
}
}
}
@Override
protected boolean isCompatible(EventLoop loop) {
return loop instanceof ThreadPerChannelEventLoop;
}
/**
* Connect to the remote peer using the given localAddress if one is specified or {@code null} otherwise.
*/
protected abstract void doConnect(
SocketAddress remoteAddress, SocketAddress localAddress) throws Exception;
@Override
protected void doBeginRead() throws Exception {
if (readPending) {
return;
}
if (!isActive()) {
readWhenInactive = true;
return;
}
Source
Frequently Asked Questions
What is the AbstractOioChannel class?
AbstractOioChannel is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java.
Where is AbstractOioChannel defined?
AbstractOioChannel is defined in transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java at line 31.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free