GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.channel
  • DefaultChannelConfig

This view

  • Original page
  • New address

GeezerVison is showing netty.io — DefaultChannelConfig (Netty API Reference (4.1.141.Final))

Class DefaultChannelConfig

java.lang.Object
io.netty.channel.DefaultChannelConfig
All Implemented Interfaces:
ChannelConfig
Direct Known Subclasses:
DefaultDatagramChannelConfig, DefaultSctpChannelConfig, DefaultSctpServerChannelConfig, DefaultServerSocketChannelConfig, DefaultSocketChannelConfig, DefaultUdtChannelConfig, EpollChannelConfig, KQueueChannelConfig

public class DefaultChannelConfig extends Object implements ChannelConfig
The default ChannelConfig implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Channel
    channel
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    DefaultChannelConfig(Channel channel)
     
    protected
    DefaultChannelConfig(Channel channel, RecvByteBufAllocator allocator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    autoReadCleared()
    Is called once setAutoRead(boolean) is called with false and isAutoRead() was true before.
    ByteBufAllocator
    getAllocator()
    Returns ByteBufAllocator which is used for the channel to allocate buffers.
    int
    getConnectTimeoutMillis()
    Returns the connect timeout of the channel in milliseconds.
    int
    getMaxMessagesPerRead()
    Deprecated.
    int
    getMaxMessagesPerWrite()
    Get the maximum number of message to write per eventloop run.
    MessageSizeEstimator
    getMessageSizeEstimator()
    Returns MessageSizeEstimator which is used for the channel to detect the size of a message.
    <T> T
    getOption(ChannelOption<T> option)
    Return the value of the given ChannelOption
    Map<ChannelOption<?>, Object>
    getOptions()
    Return all set ChannelOption's.
    protected Map<ChannelOption<?>, Object>
    getOptions(Map<ChannelOption<?>, Object> result, ChannelOption<?>... options)
     
    <T extends RecvByteBufAllocator>
    T
    getRecvByteBufAllocator()
    Returns RecvByteBufAllocator which is used for the channel to allocate receive buffers.
    int
    getWriteBufferHighWaterMark()
    Returns the high water mark of the write buffer.
    int
    getWriteBufferLowWaterMark()
    Returns the low water mark of the write buffer.
    WriteBufferWaterMark
    getWriteBufferWaterMark()
    Returns the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
    int
    getWriteSpinCount()
    Returns the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value.
    boolean
    isAutoClose()
    Returns true if and only if the Channel will be closed automatically and immediately on write failure.
    boolean
    isAutoRead()
    Returns true if and only if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all.
    ChannelConfig
    setAllocator(ByteBufAllocator allocator)
    Set the ByteBufAllocator which is used for the channel to allocate buffers.
    ChannelConfig
    setAutoClose(boolean autoClose)
    Sets whether the Channel should be closed automatically and immediately on write failure.
    ChannelConfig
    setAutoRead(boolean autoRead)
    Sets if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all.
    ChannelConfig
    setConnectTimeoutMillis(int connectTimeoutMillis)
    Sets the connect timeout of the channel in milliseconds.
    ChannelConfig
    setMaxMessagesPerRead(int maxMessagesPerRead)
    Deprecated.
    ChannelConfig
    setMaxMessagesPerWrite(int maxMessagesPerWrite)
    Set the maximum number of message to write per eventloop run.
    ChannelConfig
    setMessageSizeEstimator(MessageSizeEstimator estimator)
    Set the MessageSizeEstimator which is used for the channel to detect the size of a message.
    <T> boolean
    setOption(ChannelOption<T> option, T value)
    Sets a configuration property with the specified name and value.
    boolean
    setOptions(Map<ChannelOption<?>, ?> options)
    Sets the configuration properties from the specified Map.
    ChannelConfig
    setRecvByteBufAllocator(RecvByteBufAllocator allocator)
    Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
    ChannelConfig
    setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
    Sets the high water mark of the write buffer.
    ChannelConfig
    setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
    Sets the low water mark of the write buffer.
    ChannelConfig
    setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
    Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
    ChannelConfig
    setWriteSpinCount(int writeSpinCount)
    Sets the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value.
    protected <T> void
    validate(ChannelOption<T> option, T value)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • channel

      protected final Channel channel
  • Constructor Details

    • DefaultChannelConfig

      public DefaultChannelConfig(Channel channel)
    • DefaultChannelConfig

      protected DefaultChannelConfig(Channel channel, RecvByteBufAllocator allocator)
  • Method Details

    • getOptions

      public Map<ChannelOption<?>, Object> getOptions()
      Description copied from interface: ChannelConfig
      Return all set ChannelOption's.
      Specified by:
      getOptions in interface ChannelConfig
    • getOptions

      protected Map<ChannelOption<?>, Object> getOptions(Map<ChannelOption<?>, Object> result, ChannelOption<?>... options)
    • setOptions

      public boolean setOptions(Map<ChannelOption<?>, ?> options)
      Description copied from interface: ChannelConfig
      Sets the configuration properties from the specified Map.
      Specified by:
      setOptions in interface ChannelConfig
    • getOption

      public <T> T getOption(ChannelOption<T> option)
      Description copied from interface: ChannelConfig
      Return the value of the given ChannelOption
      Specified by:
      getOption in interface ChannelConfig
    • setOption

      public <T> boolean setOption(ChannelOption<T> option, T value)
      Description copied from interface: ChannelConfig
      Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:
      public boolean setOption(ChannelOption<T> option, T value) {
          if (super.setOption(option, value)) {
              return true;
          }
      
          if (option.equals(additionalOption)) {
              ....
              return true;
          }
      
          return false;
      }
      
      Specified by:
      setOption in interface ChannelConfig
      Returns:
      true if and only if the property has been set
    • validate

      protected <T> void validate(ChannelOption<T> option, T value)
    • getConnectTimeoutMillis

      public int getConnectTimeoutMillis()
      Description copied from interface: ChannelConfig
      Returns the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.
      Specified by:
      getConnectTimeoutMillis in interface ChannelConfig
      Returns:
      the connect timeout in milliseconds. 0 if disabled.
    • setConnectTimeoutMillis

      public ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
      Description copied from interface: ChannelConfig
      Sets the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.
      Specified by:
      setConnectTimeoutMillis in interface ChannelConfig
      Parameters:
      connectTimeoutMillis - the connect timeout in milliseconds. 0 to disable.
    • getMaxMessagesPerRead

      @Deprecated public int getMaxMessagesPerRead()
      Deprecated.

      Specified by:
      getMaxMessagesPerRead in interface ChannelConfig
      Throws:
      IllegalStateException - if getRecvByteBufAllocator() does not return an object of type MaxMessagesRecvByteBufAllocator.
    • setMaxMessagesPerRead

      @Deprecated public ChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
      Deprecated.

      Specified by:
      setMaxMessagesPerRead in interface ChannelConfig
      Throws:
      IllegalStateException - if getRecvByteBufAllocator() does not return an object of type MaxMessagesRecvByteBufAllocator.
    • getMaxMessagesPerWrite

      public int getMaxMessagesPerWrite()
      Get the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages.
    • setMaxMessagesPerWrite

      public ChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite)
      Set the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages.
    • getWriteSpinCount

      public int getWriteSpinCount()
      Description copied from interface: ChannelConfig
      Returns the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value. It is similar to what a spin lock is used for in concurrency programming. It improves memory utilization and write throughput depending on the platform that JVM runs on. The default value is 16.
      Specified by:
      getWriteSpinCount in interface ChannelConfig
    • setWriteSpinCount

      public ChannelConfig setWriteSpinCount(int writeSpinCount)
      Description copied from interface: ChannelConfig
      Sets the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value. It is similar to what a spin lock is used for in concurrency programming. It improves memory utilization and write throughput depending on the platform that JVM runs on. The default value is 16.
      Specified by:
      setWriteSpinCount in interface ChannelConfig
    • getAllocator

      public ByteBufAllocator getAllocator()
      Description copied from interface: ChannelConfig
      Returns ByteBufAllocator which is used for the channel to allocate buffers.
      Specified by:
      getAllocator in interface ChannelConfig
    • setAllocator

      public ChannelConfig setAllocator(ByteBufAllocator allocator)
      Description copied from interface: ChannelConfig
      Set the ByteBufAllocator which is used for the channel to allocate buffers.
      Specified by:
      setAllocator in interface ChannelConfig
    • getRecvByteBufAllocator

      public <T extends RecvByteBufAllocator> T getRecvByteBufAllocator()
      Description copied from interface: ChannelConfig
      Returns RecvByteBufAllocator which is used for the channel to allocate receive buffers.
      Specified by:
      getRecvByteBufAllocator in interface ChannelConfig
    • setRecvByteBufAllocator

      public ChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
      Description copied from interface: ChannelConfig
      Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
      Specified by:
      setRecvByteBufAllocator in interface ChannelConfig
    • isAutoRead

      public boolean isAutoRead()
      Description copied from interface: ChannelConfig
      Returns true if and only if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all. The default value is true.
      Specified by:
      isAutoRead in interface ChannelConfig
    • setAutoRead

      public ChannelConfig setAutoRead(boolean autoRead)
      Description copied from interface: ChannelConfig
      Sets if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all. The default value is true.
      Specified by:
      setAutoRead in interface ChannelConfig
    • autoReadCleared

      protected void autoReadCleared()
      Is called once setAutoRead(boolean) is called with false and isAutoRead() was true before.
    • isAutoClose

      public boolean isAutoClose()
      Description copied from interface: ChannelConfig
      Returns true if and only if the Channel will be closed automatically and immediately on write failure. The default is true.
      Specified by:
      isAutoClose in interface ChannelConfig
    • setAutoClose

      public ChannelConfig setAutoClose(boolean autoClose)
      Description copied from interface: ChannelConfig
      Sets whether the Channel should be closed automatically and immediately on write failure. The default is true.
      Specified by:
      setAutoClose in interface ChannelConfig
    • getWriteBufferHighWaterMark

      public int getWriteBufferHighWaterMark()
      Description copied from interface: ChannelConfig
      Returns the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value, Channel.isWritable() will start to return false.
      Specified by:
      getWriteBufferHighWaterMark in interface ChannelConfig
    • setWriteBufferHighWaterMark

      public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
      Description copied from interface: ChannelConfig

      Sets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value, Channel.isWritable() will start to return false.

      Specified by:
      setWriteBufferHighWaterMark in interface ChannelConfig
    • getWriteBufferLowWaterMark

      public int getWriteBufferLowWaterMark()
      Description copied from interface: ChannelConfig
      Returns the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value, Channel.isWritable() will start to return true again.
      Specified by:
      getWriteBufferLowWaterMark in interface ChannelConfig
    • setWriteBufferLowWaterMark

      public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
      Description copied from interface: ChannelConfig

      Sets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value, Channel.isWritable() will start to return true again.

      Specified by:
      setWriteBufferLowWaterMark in interface ChannelConfig
    • setWriteBufferWaterMark

      public ChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
      Description copied from interface: ChannelConfig
      Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
      Specified by:
      setWriteBufferWaterMark in interface ChannelConfig
    • getWriteBufferWaterMark

      public WriteBufferWaterMark getWriteBufferWaterMark()
      Description copied from interface: ChannelConfig
      Returns the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
      Specified by:
      getWriteBufferWaterMark in interface ChannelConfig
    • getMessageSizeEstimator

      public MessageSizeEstimator getMessageSizeEstimator()
      Description copied from interface: ChannelConfig
      Returns MessageSizeEstimator which is used for the channel to detect the size of a message.
      Specified by:
      getMessageSizeEstimator in interface ChannelConfig
    • setMessageSizeEstimator

      public ChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
      Description copied from interface: ChannelConfig
      Set the MessageSizeEstimator which is used for the channel to detect the size of a message.
      Specified by:
      setMessageSizeEstimator in interface ChannelConfig
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.