org.apache.http.impl.nio.reactor

## Class ChannelEntry

- java.lang.Object
- - org.apache.http.impl.nio.reactor.ChannelEntry

-     @Immutable
      public class ChannelEntry
      extends Object

  `SocketChannel` entry maintained by the I/O reactor. If the channel represents an outgoing client connection, this entry also contains the original `SessionRequestImpl` used to request it.
  Since:
    4.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChannelEntry(SocketChannel channel)` Creates new ChannelEntry.
    `ChannelEntry(SocketChannel channel, SessionRequestImpl sessionRequest)` Creates new ChannelEntry.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getAttachment()` Returns the original session request attachment, if available.
    `SocketChannel` | `getChannel()` Returns the channel.
    `SessionRequestImpl` | `getSessionRequest()` Returns the original session request, if available.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChannelEntry

          public ChannelEntry(SocketChannel channel,
                      SessionRequestImpl sessionRequest)

      Creates new ChannelEntry.
      Parameters:
        `channel` - the channel
        `sessionRequest` - original session request. Can be `null` if the channel represents an incoming server-side connection.

    - #### ChannelEntry

          public ChannelEntry(SocketChannel channel)

      Creates new ChannelEntry.
      Parameters:
        `channel` - the channel.

  - ### Method Detail

    - #### getSessionRequest

          public SessionRequestImpl getSessionRequest()

      Returns the original session request, if available. If the channel entry represents an incoming server-side connection, returns `null`.
      Returns:
        the original session request, if client-side channel, `null` otherwise.

    - #### getAttachment

          public Object getAttachment()

      Returns the original session request attachment, if available.
      Returns:
        the original session request attachment, if available, `null` otherwise.

    - #### getChannel

          public SocketChannel getChannel()

      Returns the channel.
      Returns:
        the channel.

Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.