Class AbstractNetworkChannelEndpoint<S extends Channel, U extends NetworkChannel>

java.lang.Object
org.apache.tomcat.util.net.AbstractEndpoint<S,U>
org.apache.tomcat.util.net.AbstractNetworkChannelEndpoint<S,U>
Type Parameters:
S - The channel type
U - The network channel type
Direct Known Subclasses:
Nio2Endpoint, NioEndpoint

public abstract class AbstractNetworkChannelEndpoint<S extends Channel, U extends NetworkChannel> extends AbstractEndpoint<S,U>
Provides a base implementation for endpoints that use a NetworkChannel.
  • Constructor Details

    • AbstractNetworkChannelEndpoint

      public AbstractNetworkChannelEndpoint()
      Constructs a new endpoint.
  • Method Details

    • getServerSocket

      protected abstract NetworkChannel getServerSocket()
      Returns the server socket used by this endpoint.
      Returns:
      the server socket
    • createChannel

      protected abstract S createChannel(SocketBufferHandler buffer)
      Creates the channel to be used by this endpoint.
      Parameters:
      buffer - The buffer handler to use for the channel
      Returns:
      the created channel
    • getLocalAddress

      protected final InetSocketAddress getLocalAddress() throws IOException
      Description copied from class: AbstractEndpoint
      Obtain the network address the server socket is bound to. This primarily exists to enable the correct address to be used when unlocking the server socket since it removes the guess-work involved if no address is specifically set.
      Specified by:
      getLocalAddress in class AbstractEndpoint<S extends Channel, U extends NetworkChannel>
      Returns:
      The network address that the server socket is listening on or null if the server socket is not currently bound.
      Throws:
      IOException - If there is a problem determining the currently bound socket