Interface NettyChannelHandlerFactory


public interface NettyChannelHandlerFactory
Defines a factory for ChannelHandler instances. The instances created by an implementation are directly added to, or removed from, a pipeline.
Author:
Guus der Kinderen, guus@goodbytes.nl
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addNewHandlerTo(io.netty.channel.ChannelPipeline pipeline)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    addNewHandlerTo(io.netty.channel.ChannelPipeline pipeline, io.netty.util.concurrent.EventExecutorGroup executor)
    Add a new ChannelHandler to the provided pipeline using the given executor.
    void
    removeHandlerFrom(io.netty.channel.ChannelPipeline pipeline)
    Remove a ChannelHandler from the provided pipeline.
  • Method Details

    • addNewHandlerTo

      @Deprecated(forRemoval=true, since="5.1.0") void addNewHandlerTo(io.netty.channel.ChannelPipeline pipeline)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new ChannelHandler to the provided pipeline. It is assumed, but not required, that for each invocation, a new ChannelHandler is created.
      Parameters:
      pipeline - The pipeline to which a ChannelHandler is to be added.
    • addNewHandlerTo

      default void addNewHandlerTo(io.netty.channel.ChannelPipeline pipeline, io.netty.util.concurrent.EventExecutorGroup executor)
      Add a new ChannelHandler to the provided pipeline using the given executor. It is assumed, but not required, that for each invocation, a new ChannelHandler is created. Implementations should ensure that the handler is executed on the given EventExecutorGroup. By default, this delegates to addNewHandlerTo(ChannelPipeline) for backward compatibility.
      Parameters:
      pipeline - The pipeline to which a ChannelHandler is to be added.
      executor - the EventExecutorGroup which will be used to execute the ChannelHandler methods.
    • removeHandlerFrom

      void removeHandlerFrom(io.netty.channel.ChannelPipeline pipeline)
      Remove a ChannelHandler from the provided pipeline. Implementations should ensure that ChannelHandlers added via addNewHandlerTo(ChannelPipeline, EventExecutorGroup) can be removed again by invocation of this method.
      Parameters:
      pipeline - The pipeline to which a ChannelHandler is to be added.