Interface NetworkConnector

All Superinterfaces:
AutoCloseable, Closeable, Connector, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle
All Known Implementing Classes:
AbstractNetworkConnector, NetworkTrafficServerConnector, ServerConnector

public interface NetworkConnector extends Connector, Closeable

A Connector for TCP/IP network connectors

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Receives notifications of the open() and close() events.

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

    org.eclipse.jetty.util.component.Graceful.Shutdown, org.eclipse.jetty.util.component.Graceful.ThrowingRunnable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Performs the activities needed to close the network communication (for example, to stop accepting network connections).
     
    int
     
    int
     
    boolean
    A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)
    void
    Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    addBean, addBean, addEventListener, getBean, getBeans, getBeans, getCachedBeans, getContainedBeans, getEventListeners, isManaged, manage, removeBean, removeEventListener, unmanage

    Methods inherited from interface org.eclipse.jetty.util.component.Graceful

    isShutdown, shutdown

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
  • Method Details

    • open

      void open() throws IOException

      Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).

      Implementation must be idempotent.

      Throws:
      IOException - if this connector cannot be opened
      See Also:
    • close

      void close()

      Performs the activities needed to close the network communication (for example, to stop accepting network connections).

      Once a connector has been closed, it cannot be opened again without first calling LifeCycle.stop() and it will not be active again until a subsequent call to LifeCycle.start().

      Implementation must be idempotent.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • isOpen

      boolean isOpen()
      A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)
      Returns:
      True if the connector is Open.
    • getHost

      String getHost()
      Returns:
      The hostname representing the interface to which this connector will bind, or null for all interfaces.
    • getPort

      int getPort()
      Returns:
      The configured port for the connector or 0 if any available port may be used.
    • getLocalPort

      int getLocalPort()
      Returns:
      The actual port the connector is listening on, or -1 if it has not been opened, or -2 if it has been closed.