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
  • AbstractChannel

This view

  • Original page
  • New address

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

Class AbstractChannel

java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
All Implemented Interfaces:
Channel, ChannelOutboundInvoker, AttributeMap, Comparable<Channel>
Direct Known Subclasses:
AbstractEpollServerChannel, AbstractEpollStreamChannel, AbstractKQueueServerChannel, AbstractKQueueStreamChannel, AbstractNioChannel, AbstractOioChannel, AbstractServerChannel, EmbeddedChannel, EpollDatagramChannel, EpollDomainDatagramChannel, KQueueDatagramChannel, KQueueDomainDatagramChannel, LocalChannel

public abstract class AbstractChannel extends DefaultAttributeMap implements Channel
A skeletal Channel implementation.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    AbstractChannel.AbstractUnsafe
    Channel.Unsafe implementation which sub-classes must extend and use.

    Nested classes/interfaces inherited from interface Channel

    Channel.Unsafe
    Modifier and Type
    Interface
    Description
    static interface 
    Channel.Unsafe
    Unsafe operations that should never be called from user-code.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractChannel(Channel parent)
    Creates a new instance.
    protected
    AbstractChannel(Channel parent, ChannelId id)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    ByteBufAllocator
    alloc()
    Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
    ChannelFuture
    bind(SocketAddress localAddress)
    Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    bind(SocketAddress localAddress, ChannelPromise promise)
    Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    long
    bytesBeforeUnwritable()
    Get how many bytes can be written until Channel.isWritable() returns false.
    long
    bytesBeforeWritable()
    Get how many bytes must be drained from underlying buffers until Channel.isWritable() returns true.
    ChannelFuture
    close()
    Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    close(ChannelPromise promise)
    Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    closeFuture()
    Returns the ChannelFuture which will be notified when this channel is closed.
    final int
    compareTo(Channel o)
     
    ChannelFuture
    connect(SocketAddress remoteAddress)
    Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    connect(SocketAddress remoteAddress, ChannelPromise promise)
    Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    connect(SocketAddress remoteAddress, SocketAddress localAddress)
    Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
    Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    deregister()
    Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    deregister(ChannelPromise promise)
    Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    disconnect()
    Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    ChannelFuture
    disconnect(ChannelPromise promise)
    Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
    protected abstract void
    doBeginRead()
    Schedule a read operation.
    protected abstract void
    doBind(SocketAddress localAddress)
    Bind the Channel to the SocketAddress
    protected abstract void
    doClose()
    Close the Channel
    protected void
    doDeregister()
    Deregister the Channel from its EventLoop.
    protected abstract void
    doDisconnect()
    Disconnect this Channel from its remote peer
    protected void
    doRegister()
    Is called after the Channel is registered with its EventLoop as part of the register process.
    protected void
    doShutdownOutput()
    Called when conditions justify shutting down the output portion of the channel.
    protected abstract void
    doWrite(ChannelOutboundBuffer in)
    Flush the content of the given buffer to the remote peer.
    final boolean
    equals(Object o)
    Returns true if and only if the specified object is identical with this channel (i.e: this == o).
    EventLoop
    eventLoop()
    Return the EventLoop this Channel was registered to.
    protected FileChannel
    fileChannel(DefaultFileRegion region)
    Returns the underlying FileChannel, or null if the region is not open.
    protected Object
    filterOutboundMessage(Object msg)
    Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another.
    Channel
    flush()
    Request to flush all pending messages via this ChannelOutboundInvoker.
    final int
    hashCode()
    Returns the ID of this channel.
    final ChannelId
    id()
    Returns the globally unique identifier of this Channel.
    protected void
    invalidateLocalAddress()
    Deprecated.
    no use-case for this.
    protected void
    invalidateRemoteAddress()
    Deprecated.
    no use-case for this.
    protected abstract boolean
    isCompatible(EventLoop loop)
    Return true if the given EventLoop is compatible with this instance.
    boolean
    isRegistered()
    Returns true if the Channel is registered with an EventLoop.
    boolean
    isWritable()
    Returns true if and only if the I/O thread will perform the requested write operation immediately.
    SocketAddress
    localAddress()
    Returns the local address where this channel is bound to.
    protected abstract SocketAddress
    localAddress0()
    Returns the SocketAddress which is bound locally.
    protected final int
    maxMessagesPerWrite()
     
    protected DefaultChannelPipeline
    newChannelPipeline()
    Returns a new DefaultChannelPipeline instance.
    ChannelFuture
    newFailedFuture(Throwable cause)
    Create a new ChannelFuture which is marked as failed already.
    protected ChannelId
    newId()
    Returns a new DefaultChannelId instance.
    ChannelProgressivePromise
    newProgressivePromise()
    Return an new ChannelProgressivePromise
    ChannelPromise
    newPromise()
    Return a new ChannelPromise.
    ChannelFuture
    newSucceededFuture()
    Create a new ChannelFuture which is marked as succeeded already.
    protected abstract AbstractChannel.AbstractUnsafe
    newUnsafe()
    Create a new AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel
    Channel
    parent()
    Returns the parent of this channel.
    ChannelPipeline
    pipeline()
    Return the assigned ChannelPipeline.
    Channel
    read()
    Request to Read data from the Channel into the first inbound buffer, triggers an ChannelInboundHandler.channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading.
    SocketAddress
    remoteAddress()
    Returns the remote address where this channel is connected to.
    protected abstract SocketAddress
    remoteAddress0()
    Return the SocketAddress which the Channel is connected to.
    String
    toString()
    Returns the String representation of this channel.
    Channel.Unsafe
    unsafe()
    Returns an internal-use-only object that provides unsafe operations.
    protected void
    validateFileRegion(DefaultFileRegion region, long position)
     
    final ChannelPromise
    voidPromise()
    Return a special ChannelPromise which can be reused for different operations.
    ChannelFuture
    write(Object msg)
    Request to write a message via this ChannelHandlerContext through the ChannelPipeline.
    ChannelFuture
    write(Object msg, ChannelPromise promise)
    Request to write a message via this ChannelHandlerContext through the ChannelPipeline.
    ChannelFuture
    writeAndFlush(Object msg)
    Shortcut for call ChannelOutboundInvoker.write(Object) and ChannelOutboundInvoker.flush().
    ChannelFuture
    writeAndFlush(Object msg, ChannelPromise promise)
    Shortcut for call ChannelOutboundInvoker.write(Object, ChannelPromise) and ChannelOutboundInvoker.flush().

    Methods inherited from class DefaultAttributeMap

    attr, hasAttr
    Modifier and Type
    Method
    Description
    <T> Attribute<T>
    attr(AttributeKey<T> key)
    Get the Attribute for the given AttributeKey.
    <T> boolean
    hasAttr(AttributeKey<T> key)
    Returns true if and only if the given Attribute exists in this AttributeMap.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Channel

    config, isActive, isOpen, metadata
    Modifier and Type
    Method
    Description
    ChannelConfig
    config()
    Returns the configuration of this channel.
    boolean
    isActive()
    Return true if the Channel is active and so connected.
    boolean
    isOpen()
    Returns true if the Channel is open and may get active later
    ChannelMetadata
    metadata()
    Return the ChannelMetadata of the Channel which describe the nature of the Channel.
  • Constructor Details

    • AbstractChannel

      protected AbstractChannel(Channel parent)
      Creates a new instance.
      Parameters:
      parent - the parent of this channel. null if there's no parent.
    • AbstractChannel

      protected AbstractChannel(Channel parent, ChannelId id)
      Creates a new instance.
      Parameters:
      parent - the parent of this channel. null if there's no parent.
  • Method Details

    • maxMessagesPerWrite

      protected final int maxMessagesPerWrite()
    • id

      public final ChannelId id()
      Description copied from interface: Channel
      Returns the globally unique identifier of this Channel.
      Specified by:
      id in interface Channel
    • newId

      protected ChannelId newId()
      Returns a new DefaultChannelId instance. Subclasses may override this method to assign custom ChannelIds to Channels that use the AbstractChannel(Channel) constructor.
    • newChannelPipeline

      protected DefaultChannelPipeline newChannelPipeline()
      Returns a new DefaultChannelPipeline instance.
    • isWritable

      public boolean isWritable()
      Description copied from interface: Channel
      Returns true if and only if the I/O thread will perform the requested write operation immediately. Any write requests made when this method returns false are queued until the I/O thread is ready to process the queued write requests. WriteBufferWaterMark can be used to configure on which condition the write buffer would cause this channel to change writability.
      Specified by:
      isWritable in interface Channel
    • bytesBeforeUnwritable

      public long bytesBeforeUnwritable()
      Description copied from interface: Channel
      Get how many bytes can be written until Channel.isWritable() returns false. This quantity will always be non-negative. If Channel.isWritable() is false then 0. WriteBufferWaterMark can be used to define writability settings.
      Specified by:
      bytesBeforeUnwritable in interface Channel
    • bytesBeforeWritable

      public long bytesBeforeWritable()
      Description copied from interface: Channel
      Get how many bytes must be drained from underlying buffers until Channel.isWritable() returns true. This quantity will always be non-negative. If Channel.isWritable() is true then 0. WriteBufferWaterMark can be used to define writability settings.
      Specified by:
      bytesBeforeWritable in interface Channel
    • parent

      public Channel parent()
      Description copied from interface: Channel
      Returns the parent of this channel.
      Specified by:
      parent in interface Channel
      Returns:
      the parent channel. null if this channel does not have a parent channel.
    • pipeline

      public ChannelPipeline pipeline()
      Description copied from interface: Channel
      Return the assigned ChannelPipeline.
      Specified by:
      pipeline in interface Channel
    • alloc

      public ByteBufAllocator alloc()
      Description copied from interface: Channel
      Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
      Specified by:
      alloc in interface Channel
    • eventLoop

      public EventLoop eventLoop()
      Description copied from interface: Channel
      Return the EventLoop this Channel was registered to.
      Specified by:
      eventLoop in interface Channel
    • localAddress

      public SocketAddress localAddress()
      Description copied from interface: Channel
      Returns the local address where this channel is bound to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.
      Specified by:
      localAddress in interface Channel
      Returns:
      the local address of this channel. null if this channel is not bound.
    • invalidateLocalAddress

      @Deprecated protected void invalidateLocalAddress()
      Deprecated.
      no use-case for this.
    • remoteAddress

      public SocketAddress remoteAddress()
      Description copied from interface: Channel
      Returns the remote address where this channel is connected to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.
      Specified by:
      remoteAddress in interface Channel
      Returns:
      the remote address of this channel. null if this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g. DatagramChannel, use DefaultAddressedEnvelope.recipient() to determine the origination of the received message as this method will return null.
    • invalidateRemoteAddress

      @Deprecated protected void invalidateRemoteAddress()
      Deprecated.
      no use-case for this.
    • isRegistered

      public boolean isRegistered()
      Description copied from interface: Channel
      Returns true if the Channel is registered with an EventLoop.
      Specified by:
      isRegistered in interface Channel
    • bind

      public ChannelFuture bind(SocketAddress localAddress)
      Description copied from interface: ChannelOutboundInvoker
      Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

      This will result in having the ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      bind in interface ChannelOutboundInvoker
    • connect

      public ChannelFuture connect(SocketAddress remoteAddress)
      Description copied from interface: ChannelOutboundInvoker
      Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

      If the connection fails because of a connection timeout, the ChannelFuture will get failed with a ConnectTimeoutException. If it fails because of connection refused a ConnectException will be used.

      This will result in having the ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      connect in interface ChannelOutboundInvoker
    • connect

      public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
      Description copied from interface: ChannelOutboundInvoker
      Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

      This will result in having the ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      connect in interface ChannelOutboundInvoker
    • disconnect

      public ChannelFuture disconnect()
      Description copied from interface: ChannelOutboundInvoker
      Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

      This will result in having the ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      disconnect in interface ChannelOutboundInvoker
    • close

      public ChannelFuture close()
      Description copied from interface: ChannelOutboundInvoker
      Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.

      This will result in having the ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      close in interface ChannelOutboundInvoker
    • deregister

      public ChannelFuture deregister()
      Description copied from interface: ChannelOutboundInvoker
      Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

      This will result in having the ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      deregister in interface ChannelOutboundInvoker
    • flush

      public Channel flush()
      Description copied from interface: ChannelOutboundInvoker
      Request to flush all pending messages via this ChannelOutboundInvoker.
      Specified by:
      flush in interface Channel
      Specified by:
      flush in interface ChannelOutboundInvoker
    • bind

      public ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

      This will result in having the ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      bind in interface ChannelOutboundInvoker
    • connect

      public ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelFuture will be notified.

      If the connection fails because of a connection timeout, the ChannelFuture will get failed with a ConnectTimeoutException. If it fails because of connection refused a ConnectException will be used.

      This will result in having the ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      connect in interface ChannelOutboundInvoker
    • connect

      public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified and also returned.

      This will result in having the ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      connect in interface ChannelOutboundInvoker
    • disconnect

      public ChannelFuture disconnect(ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

      This will result in having the ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      disconnect in interface ChannelOutboundInvoker
    • close

      public ChannelFuture close(ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again. The given ChannelPromise will be notified.

      This will result in having the ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      close in interface ChannelOutboundInvoker
    • deregister

      public ChannelFuture deregister(ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

      This will result in having the ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      deregister in interface ChannelOutboundInvoker
    • read

      public Channel read()
      Description copied from interface: ChannelOutboundInvoker
      Request to Read data from the Channel into the first inbound buffer, triggers an ChannelInboundHandler.channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.

      This will result in having the ChannelOutboundHandler.read(ChannelHandlerContext) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

      Specified by:
      read in interface Channel
      Specified by:
      read in interface ChannelOutboundInvoker
    • write

      public ChannelFuture write(Object msg)
      Description copied from interface: ChannelOutboundInvoker
      Request to write a message via this ChannelHandlerContext through the ChannelPipeline. This method will not request to actual flush, so be sure to call ChannelOutboundInvoker.flush() once you want to request to flush all pending data to the actual transport.
      Specified by:
      write in interface ChannelOutboundInvoker
    • write

      public ChannelFuture write(Object msg, ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Request to write a message via this ChannelHandlerContext through the ChannelPipeline. This method will not request to actual flush, so be sure to call ChannelOutboundInvoker.flush() once you want to request to flush all pending data to the actual transport.
      Specified by:
      write in interface ChannelOutboundInvoker
    • writeAndFlush

      public ChannelFuture writeAndFlush(Object msg)
      Description copied from interface: ChannelOutboundInvoker
      Shortcut for call ChannelOutboundInvoker.write(Object) and ChannelOutboundInvoker.flush().
      Specified by:
      writeAndFlush in interface ChannelOutboundInvoker
    • writeAndFlush

      public ChannelFuture writeAndFlush(Object msg, ChannelPromise promise)
      Description copied from interface: ChannelOutboundInvoker
      Shortcut for call ChannelOutboundInvoker.write(Object, ChannelPromise) and ChannelOutboundInvoker.flush().
      Specified by:
      writeAndFlush in interface ChannelOutboundInvoker
    • newPromise

      public ChannelPromise newPromise()
      Description copied from interface: ChannelOutboundInvoker
      Return a new ChannelPromise.
      Specified by:
      newPromise in interface ChannelOutboundInvoker
    • newProgressivePromise

      public ChannelProgressivePromise newProgressivePromise()
      Description copied from interface: ChannelOutboundInvoker
      Return an new ChannelProgressivePromise
      Specified by:
      newProgressivePromise in interface ChannelOutboundInvoker
    • newSucceededFuture

      public ChannelFuture newSucceededFuture()
      Description copied from interface: ChannelOutboundInvoker
      Create a new ChannelFuture which is marked as succeeded already. So Future.isSuccess() will return true. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.
      Specified by:
      newSucceededFuture in interface ChannelOutboundInvoker
    • newFailedFuture

      public ChannelFuture newFailedFuture(Throwable cause)
      Description copied from interface: ChannelOutboundInvoker
      Create a new ChannelFuture which is marked as failed already. So Future.isSuccess() will return false. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.
      Specified by:
      newFailedFuture in interface ChannelOutboundInvoker
    • closeFuture

      public ChannelFuture closeFuture()
      Description copied from interface: Channel
      Returns the ChannelFuture which will be notified when this channel is closed. This method always returns the same future instance.
      Specified by:
      closeFuture in interface Channel
    • unsafe

      public Channel.Unsafe unsafe()
      Description copied from interface: Channel
      Returns an internal-use-only object that provides unsafe operations.
      Specified by:
      unsafe in interface Channel
    • newUnsafe

      protected abstract AbstractChannel.AbstractUnsafe newUnsafe()
      Create a new AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel
    • hashCode

      public final int hashCode()
      Returns the ID of this channel.
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object o)
      Returns true if and only if the specified object is identical with this channel (i.e: this == o).
      Overrides:
      equals in class Object
    • compareTo

      public final int compareTo(Channel o)
      Specified by:
      compareTo in interface Comparable<Channel>
    • toString

      public String toString()
      Returns the String representation of this channel. The returned string contains the ID, local address, and remote address of this channel for easier identification.
      Overrides:
      toString in class Object
    • voidPromise

      public final ChannelPromise voidPromise()
      Description copied from interface: ChannelOutboundInvoker
      Return a special ChannelPromise which can be reused for different operations.

      It's only supported to use it for ChannelOutboundInvoker.write(Object, ChannelPromise).

      Be aware that the returned ChannelPromise will not support most operations and should only be used if you want to save an object allocation for every write operation. You will not be able to detect if the operation was complete, only if it failed as the implementation will call ChannelPipeline.fireExceptionCaught(Throwable) in this case.

      Be aware this is an expert feature and should be used with care!
      Specified by:
      voidPromise in interface ChannelOutboundInvoker
    • isCompatible

      protected abstract boolean isCompatible(EventLoop loop)
      Return true if the given EventLoop is compatible with this instance.
    • localAddress0

      protected abstract SocketAddress localAddress0()
      Returns the SocketAddress which is bound locally.
    • remoteAddress0

      protected abstract SocketAddress remoteAddress0()
      Return the SocketAddress which the Channel is connected to.
    • doRegister

      protected void doRegister() throws Exception
      Is called after the Channel is registered with its EventLoop as part of the register process. Sub-classes may override this method
      Throws:
      Exception
    • doBind

      protected abstract void doBind(SocketAddress localAddress) throws Exception
      Bind the Channel to the SocketAddress
      Throws:
      Exception
    • doDisconnect

      protected abstract void doDisconnect() throws Exception
      Disconnect this Channel from its remote peer
      Throws:
      Exception
    • doClose

      protected abstract void doClose() throws Exception
      Close the Channel
      Throws:
      Exception
    • doShutdownOutput

      protected void doShutdownOutput() throws Exception
      Called when conditions justify shutting down the output portion of the channel. This may happen if a write operation throws an exception.
      Throws:
      Exception
    • doDeregister

      protected void doDeregister() throws Exception
      Deregister the Channel from its EventLoop. Sub-classes may override this method
      Throws:
      Exception
    • doBeginRead

      protected abstract void doBeginRead() throws Exception
      Schedule a read operation.
      Throws:
      Exception
    • doWrite

      protected abstract void doWrite(ChannelOutboundBuffer in) throws Exception
      Flush the content of the given buffer to the remote peer.
      Throws:
      Exception
    • filterOutboundMessage

      protected Object filterOutboundMessage(Object msg) throws Exception
      Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another. (e.g. heap buffer -> direct buffer)
      Throws:
      Exception
    • validateFileRegion

      protected void validateFileRegion(DefaultFileRegion region, long position) throws IOException
      Throws:
      IOException
    • fileChannel

      protected FileChannel fileChannel(DefaultFileRegion region)
      Returns the underlying FileChannel, or null if the region is not open. This method does not open the region.
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.