Home / Class/ ChannelInitializerExtension Class — netty Architecture

ChannelInitializerExtension Class — netty Architecture

Architecture documentation for the ChannelInitializerExtension class in ChannelInitializerExtension.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8["ChannelInitializerExtension"]
  d8e7c648_3313_d2cb_2c77_f0207e00ac0e["ChannelInitializerExtension.java"]
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8 -->|defined in| d8e7c648_3313_d2cb_2c77_f0207e00ac0e
  09c1ba83_9d8f_e14f_2d80_4e86c0f6c83f["priority()"]
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8 -->|method| 09c1ba83_9d8f_e14f_2d80_4e86c0f6c83f
  cdb2302f_1a4e_1761_da79_14ba73ec74e9["postInitializeClientChannel()"]
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8 -->|method| cdb2302f_1a4e_1761_da79_14ba73ec74e9
  b64da6f3_caf1_cb96_8d2d_3d9fca8ac424["postInitializeServerListenerChannel()"]
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8 -->|method| b64da6f3_caf1_cb96_8d2d_3d9fca8ac424
  9a240265_8088_9bf6_f83e_1e0576f64b3a["postInitializeServerChildChannel()"]
  b14627b9_df93_8cbe_ad69_dbb0b0fb9ce8 -->|method| 9a240265_8088_9bf6_f83e_1e0576f64b3a

Relationship Graph

Source Code

transport/src/main/java/io/netty/bootstrap/ChannelInitializerExtension.java lines 40–122

public abstract class ChannelInitializerExtension {
    /**
     * The name of the system property that control initializer extensions.
     * <p>
     * These extensions can potentially be a security liability, so they are disabled by default.
     * <p>
     * To enable the extensions, application operators can explicitly opt in by setting this system property to the
     * value {@code serviceload}. This will enable all the extensions that are available through the service loader
     * mechanism.
     * <p>
     * To load and log (at INFO level) all available extensions without actually running them, set this system property
     * to the value {@code log}.
     */
    public static final String EXTENSIONS_SYSTEM_PROPERTY = "io.netty.bootstrap.extensions";

    /**
     * Get the "priority" of this extension. If multiple extensions are avilable, then they will be called in their
     * priority order, from lowest to highest.
     * <p>
     * Implementers are encouraged to pick a number between {@code -100.0} and {@code 100.0}, where extensions that have
     * no particular opinion on their priority are encouraged to return {@code 0.0}.
     * <p>
     * Extensions with lower priority will get called first, while extensions with greater priority may be able to
     * observe the effects of extensions with lesser priority.
     * <p>
     * Note that if multiple extensions have the same priority, then their relative order will be unpredictable.
     * As such, implementations should always take into consideration that other extensions might be called before
     * or after them.
     * <p>
     * Override this method to specify your own priority.
     * The default implementation just returns {@code 0}.
     *
     * @return The priority.
     */
    public double priority() {
        return 0;
    }

    /**
     * Called by {@link Bootstrap} after the initialization of the given client channel.
     * <p>
     * The method is allowed to modify the handlers in the pipeline, the channel attributes, or the channel options.
     * The method must refrain from doing any I/O, or from closing the channel.
     * <p>
     * Override this method to add your own callback logic.
     * The default implementation does nothing.
     *
     * @param channel The channel that was initialized.
     */
    public void postInitializeClientChannel(Channel channel) {
    }

    /**
     * Called by {@link ServerBootstrap} after the initialization of the given server listener channel.
     * The listener channel is responsible for invoking the {@code accept(2)} system call,
     * and for producing child channels.
     * <p>
     * The method is allowed to modify the handlers in the pipeline, the channel attributes, or the channel options.
     * The method must refrain from doing any I/O, or from closing the channel.
     * <p>
     * Override this method to add your own callback logic.
     * The default implementation does nothing.
     *
     * @param channel The channel that was initialized.
     */
    public void postInitializeServerListenerChannel(ServerChannel channel) {
    }

    /**
     * Called by {@link ServerBootstrap} after the initialization of the given child channel.
     * A child channel is a newly established connection from a client to the server.
     * <p>
     * The method is allowed to modify the handlers in the pipeline, the channel attributes, or the channel options.
     * The method must refrain from doing any I/O, or from closing the channel.
     * <p>
     * Override this method to add your own callback logic.
     * The default implementation does nothing.
     *
     * @param channel The channel that was initialized.
     */
    public void postInitializeServerChildChannel(Channel channel) {

Frequently Asked Questions

What is the ChannelInitializerExtension class?
ChannelInitializerExtension is a class in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/ChannelInitializerExtension.java.
Where is ChannelInitializerExtension defined?
ChannelInitializerExtension is defined in transport/src/main/java/io/netty/bootstrap/ChannelInitializerExtension.java at line 40.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free