AbstractBootstrap Class — netty Architecture
Architecture documentation for the AbstractBootstrap class in AbstractBootstrap.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a88dc2b3_b55b_4623_5b37_4c0fc9181bb9["AbstractBootstrap"] 05a9a8b1_0187_702f_2a42_748428efe210["AbstractBootstrap.java"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|defined in| 05a9a8b1_0187_702f_2a42_748428efe210 36075182_7e5d_783e_b506_cc27efda7494["AbstractBootstrap()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 36075182_7e5d_783e_b506_cc27efda7494 980c977b_e6db_91ed_7996_6d818ad80883["B()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 980c977b_e6db_91ed_7996_6d818ad80883 7ef04b23_ebc4_400b_e1bc_fdc2c162dfe6["ChannelFuture()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 7ef04b23_ebc4_400b_e1bc_fdc2c162dfe6 02b3bfe1_fab8_e7ce_bac0_65fbade71a93["init()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 02b3bfe1_fab8_e7ce_bac0_65fbade71a93 938acea9_91b1_7d11_e010_b41a06de9d99["getInitializerExtensions()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 938acea9_91b1_7d11_e010_b41a06de9d99 5bfd9a02_4ee5_8476_79ba_dcf7e5319962["doBind0()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 5bfd9a02_4ee5_8476_79ba_dcf7e5319962 89aa8ab9_d404_4fe3_1b6a_5a2cee31c749["EventLoopGroup()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 89aa8ab9_d404_4fe3_1b6a_5a2cee31c749 b2335448_fcc4_5978_92e5_ab3d6752c90e["config()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| b2335448_fcc4_5978_92e5_ab3d6752c90e 61550b4d_b5b0_56c3_3da4_8f9f32ddb9b1["newOptionsArray()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 61550b4d_b5b0_56c3_3da4_8f9f32ddb9b1 356be3ef_c778_f571_e0e0_37d4dd52eff5["newAttributesArray()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 356be3ef_c778_f571_e0e0_37d4dd52eff5 4f7ba902_e303_04f5_ccf3_9d96e4f72ed3["options0()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 4f7ba902_e303_04f5_ccf3_9d96e4f72ed3 ed4ed7a7_1c29_81e3_c143_3dafaa90b251["attrs0()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| ed4ed7a7_1c29_81e3_c143_3dafaa90b251 097b08d9_ab31_0e95_c26d_2f1d09666da6["SocketAddress()"] a88dc2b3_b55b_4623_5b37_4c0fc9181bb9 -->|method| 097b08d9_ab31_0e95_c26d_2f1d09666da6
Relationship Graph
Source Code
transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java lines 55–537
public abstract class AbstractBootstrap<B extends AbstractBootstrap<B, C>, C extends Channel> implements Cloneable {
private static final boolean CLOSE_ON_SET_OPTION_FAILURE = SystemPropertyUtil.getBoolean(
"io.netty.bootstrap.closeOnSetOptionFailure", true);
@SuppressWarnings("unchecked")
private static final Map.Entry<ChannelOption<?>, Object>[] EMPTY_OPTION_ARRAY = new Map.Entry[0];
@SuppressWarnings("unchecked")
private static final Map.Entry<AttributeKey<?>, Object>[] EMPTY_ATTRIBUTE_ARRAY = new Map.Entry[0];
volatile EventLoopGroup group;
@SuppressWarnings("deprecation")
private volatile ChannelFactory<? extends C> channelFactory;
private volatile SocketAddress localAddress;
// The order in which ChannelOptions are applied is important they may depend on each other for validation
// purposes.
private final Map<ChannelOption<?>, Object> options = new LinkedHashMap<ChannelOption<?>, Object>();
private final Map<AttributeKey<?>, Object> attrs = new ConcurrentHashMap<AttributeKey<?>, Object>();
private volatile ChannelHandler handler;
private volatile ClassLoader extensionsClassLoader;
AbstractBootstrap() {
// Disallow extending from a different package.
}
AbstractBootstrap(AbstractBootstrap<B, C> bootstrap) {
group = bootstrap.group;
channelFactory = bootstrap.channelFactory;
handler = bootstrap.handler;
localAddress = bootstrap.localAddress;
synchronized (bootstrap.options) {
options.putAll(bootstrap.options);
}
attrs.putAll(bootstrap.attrs);
extensionsClassLoader = bootstrap.extensionsClassLoader;
}
/**
* The {@link EventLoopGroup} which is used to handle all the events for the to-be-created
* {@link Channel}
*/
public B group(EventLoopGroup group) {
ObjectUtil.checkNotNull(group, "group");
if (this.group != null) {
throw new IllegalStateException("group set already");
}
this.group = group;
return self();
}
@SuppressWarnings("unchecked")
private B self() {
return (B) this;
}
/**
* The {@link Class} which is used to create {@link Channel} instances from.
* You either use this or {@link #channelFactory(io.netty.channel.ChannelFactory)} if your
* {@link Channel} implementation has no no-args constructor.
*/
public B channel(Class<? extends C> channelClass) {
return channelFactory(new ReflectiveChannelFactory<C>(
ObjectUtil.checkNotNull(channelClass, "channelClass")
));
}
/**
* @deprecated Use {@link #channelFactory(io.netty.channel.ChannelFactory)} instead.
*/
@Deprecated
public B channelFactory(ChannelFactory<? extends C> channelFactory) {
ObjectUtil.checkNotNull(channelFactory, "channelFactory");
if (this.channelFactory != null) {
throw new IllegalStateException("channelFactory set already");
}
this.channelFactory = channelFactory;
return self();
}
/**
Source
Frequently Asked Questions
What is the AbstractBootstrap class?
AbstractBootstrap is a class in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java.
Where is AbstractBootstrap defined?
AbstractBootstrap is defined in transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java at line 55.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free