init() — netty Function Reference
Architecture documentation for the init() function in ServerBootstrap.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 09073c8c_5c81_6831_9300_84392504d430["init()"] 2fb94a4f_2aca_1486_1e90_659b2d71aad5["ServerBootstrap"] 09073c8c_5c81_6831_9300_84392504d430 -->|defined in| 2fb94a4f_2aca_1486_1e90_659b2d71aad5 ea714223_dadb_7507_4730_191aee88a62f["ServerBootstrapAcceptor()"] 09073c8c_5c81_6831_9300_84392504d430 -->|calls| ea714223_dadb_7507_4730_191aee88a62f style 09073c8c_5c81_6831_9300_84392504d430 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java lines 132–174
@Override
void init(Channel channel) throws Throwable {
setChannelOptions(channel, newOptionsArray(), logger);
setAttributes(channel, newAttributesArray());
ChannelPipeline p = channel.pipeline();
final EventLoopGroup currentChildGroup = childGroup;
final ChannelHandler currentChildHandler = childHandler;
final Entry<ChannelOption<?>, Object>[] currentChildOptions = newOptionsArray(childOptions);
final Entry<AttributeKey<?>, Object>[] currentChildAttrs = newAttributesArray(childAttrs);
final Collection<ChannelInitializerExtension> extensions = getInitializerExtensions();
p.addLast(new ChannelInitializer<Channel>() {
@Override
public void initChannel(final Channel ch) {
final ChannelPipeline pipeline = ch.pipeline();
ChannelHandler handler = config.handler();
if (handler != null) {
pipeline.addLast(handler);
}
ch.eventLoop().execute(new Runnable() {
@Override
public void run() {
pipeline.addLast(new ServerBootstrapAcceptor(
ch, currentChildGroup, currentChildHandler, currentChildOptions, currentChildAttrs,
extensions));
}
});
}
});
if (!extensions.isEmpty() && channel instanceof ServerChannel) {
ServerChannel serverChannel = (ServerChannel) channel;
for (ChannelInitializerExtension extension : extensions) {
try {
extension.postInitializeServerListenerChannel(serverChannel);
} catch (Exception e) {
logger.warn("Exception thrown from postInitializeServerListenerChannel", e);
}
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does init() do?
init() is a function in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java.
Where is init() defined?
init() is defined in transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java at line 132.
What does init() call?
init() calls 1 function(s): ServerBootstrapAcceptor.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free