Class AbstractBindingHandler

java.lang.Object
org.glassfish.grizzly.AbstractBindingHandler
All Implemented Interfaces:
SocketBinder
Direct Known Subclasses:
TCPNIOBindingHandler, UDPNIOBindingHandler

public abstract class AbstractBindingHandler extends Object implements SocketBinder
Since:
2.2.19
  • Field Details

  • Constructor Details

    • AbstractBindingHandler

      public AbstractBindingHandler(NIOTransport transport)
  • Method Details

    • getProcessor

      public Processor getProcessor()
      Get the default Processor to process IOEvent, occurring on connection phase.
      Returns:
      the default Processor to process IOEvent, occurring on connection phase.
    • setProcessor

      public void setProcessor(Processor processor)
      Set the default Processor to process IOEvent, occurring on connection phase.
      Parameters:
      processor - the default Processor to process IOEvent, occurring on connection phase.
    • getProcessorSelector

      public ProcessorSelector getProcessorSelector()
      Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
      Returns:
      the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
    • setProcessorSelector

      public void setProcessorSelector(ProcessorSelector processorSelector)
      Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
      Parameters:
      processorSelector - the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
    • bind

      public Connection<?> bind(int port) throws IOException
      Binds Transport to the specific port on localhost.
      Specified by:
      bind in interface SocketBinder
      Parameters:
      port - the port to bind to
      Returns:
      bound Connection
      Throws:
      IOException - if unable to bind i.e. if port already bound
    • bind

      public Connection<?> bind(String host, int port) throws IOException
      Binds Transport to the specific host and port.
      Specified by:
      bind in interface SocketBinder
      Parameters:
      host - the local host the server will bind to
      port - specific port to bind to
      Returns:
      bound Connection
      Throws:
      IOException - if unable to bind i.e. if port already bound
    • bind

      public Connection<?> bind(String host, int port, int backlog) throws IOException
      Binds Transport to the specific host and port.
      Specified by:
      bind in interface SocketBinder
      Parameters:
      host - the local host the server will bind to
      port - the port to bind to
      backlog - the maximum length of the queue
      Returns:
      bound Connection
      Throws:
      IOException - if unable to bind i.e. if port already bound
    • bind

      public Connection<?> bind(String host, PortRange portRange, int backlog) throws IOException
      Binds Transport to the specific host, and port within a PortRange.
      Specified by:
      bind in interface SocketBinder
      Parameters:
      host - the local host the server will bind to
      portRange - PortRange.
      backlog - the maximum length of the queue
      Returns:
      bound Connection
      Throws:
      IOException - if unable to bind i.e. if port already bound
    • bind

      public Connection<?> bind(String host, PortRange portRange, boolean randomStartPort, int backlog) throws IOException
      Description copied from interface: SocketBinder
      Binds Transport to the specific host, and port within a PortRange.
      Specified by:
      bind in interface SocketBinder
      Parameters:
      host - the local host the server will bind to
      portRange - PortRange.
      randomStartPort - if true, a random port in the range will be used as the initial port.
      backlog - the maximum length of the queue
      Returns:
      bound Connection
      Throws:
      IOException - if unable to bind i.e. if port already bound
    • unbindAll

      public final void unbindAll()
      This operation is not supported by implementations of AbstractBindingHandler.
      Specified by:
      unbindAll in interface SocketBinder
      Throws:
      UnsupportedOperationException - by default
    • getSystemInheritedChannel

      protected <T> T getSystemInheritedChannel(Class<?> channelType) throws IOException
      Throws:
      IOException