Class UnixSocketConnector

All Implemented Interfaces:
Connector, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, Graceful, LifeCycle

@Deprecated(forRemoval=true) @ManagedObject("Connector using UNIX Socket") public class UnixSocketConnector extends AbstractConnector
Deprecated, for removal: This API element is subject to removal in a future version.
Use UnixDomainServerConnector from the jetty-unixdomain-server module instead (requires Java 16 or later).

A server-side connector for UNIX sockets.

  • Field Details

    • MAX_UNIX_SOCKET_PATH_LENGTH

      public static final int MAX_UNIX_SOCKET_PATH_LENGTH
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Constructor Details

    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the default configuration.

      Parameters:
      server - the Server this connector will accept connections for.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given number of selectors

      Parameters:
      server - the Server this connector will accept connections for.
      selectors - the number of selectors, or <=0 for a default value.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("factories") ConnectionFactory... factories)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given ConnectionFactories.

      Parameters:
      server - the Server this connector will accept connections for.
      factories - zero or more ConnectionFactory instances used to create and configure connections.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors, @Name("factories") ConnectionFactory... factories)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given selectors and ConnectionFactories.

      Parameters:
      server - the Server this connector will accept connections for.
      selectors - the number of selectors, or <=0 for a default value.
      factories - zero or more ConnectionFactory instances used to create and configure connections.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("sslContextFactory") SslContextFactory.Server sslContextFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given SslContextFactory.

      Parameters:
      server - the Server this connector will accept connections for.
      sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactories
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors, @Name("sslContextFactory") SslContextFactory.Server sslContextFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given selectors and SslContextFactory.

      .
      Parameters:
      server - the Server this connector will accept connections for.
      sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactories
      selectors - the number of selectors, or <=0 for a default value.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("sslContextFactory") SslContextFactory.Server sslContextFactory, @Name("factories") ConnectionFactory... factories)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given SslContextFactory and ConnectionFactories.

      .
      Parameters:
      server - the Server this connector will accept connections for.
      sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactories
      factories - zero or more ConnectionFactory instances used to create and configure connections.
    • UnixSocketConnector

      public UnixSocketConnector(@Name("server") Server server, @Name("executor") Executor executor, @Name("scheduler") Scheduler scheduler, @Name("bufferPool") ByteBufferPool bufferPool, @Name("selectors") int selectors, @Name("factories") ConnectionFactory... factories)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Constructs a UnixSocketConnector with the given parameters.

      .
      Parameters:
      server - the Server this connector will accept connections for.
      executor - the executor that runs tasks for handling requests, acceptors and selectors.
      scheduler - the scheduler used to schedule timed tasks.
      bufferPool - the ByteBufferPool used to allocate buffers.
      selectors - the number of selectors, or <=0 for a default value.
      factories - zero or more ConnectionFactory instances used to create and configure connections.
  • Method Details

    • getUnixSocket

      @ManagedAttribute("The UNIX socket file name") public String getUnixSocket()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setUnixSocket

      public void setUnixSocket(String filename)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • newSelectorManager

      protected SelectorManager newSelectorManager(Executor executor, Scheduler scheduler, int selectors)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • doStart

      protected void doStart() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContainerLifeCycle
      Starts the managed lifecycle beans in the order they were added.
      Overrides:
      doStart in class AbstractConnector
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      protected void doStop() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContainerLifeCycle
      Stops the managed lifecycle beans in the reverse order they were added.
      Overrides:
      doStop in class AbstractConnector
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • open

      public void open() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • close

      public void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • accept

      public void accept(int acceptorID) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      accept in class AbstractConnector
      Throws:
      IOException
    • accepted

      protected void accepted(jnr.unixsocket.UnixSocketChannel channel) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • getSelectorManager

      public SelectorManager getSelectorManager()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTransport

      public Object getTransport()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the underlying socket, channel, buffer etc. for the connector.
    • newEndPoint

      protected UnixSocketEndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAcceptQueueSize

      @ManagedAttribute("Accept Queue size") public int getAcceptQueueSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the accept queue size
    • setAcceptQueueSize

      public void setAcceptQueueSize(int acceptQueueSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      acceptQueueSize - the accept queue size (also known as accept backlog)
    • getReuseAddress

      @ManagedAttribute("Whether the server socket reuses addresses") public boolean getReuseAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      whether the server socket reuses addresses
      See Also:
    • setReuseAddress

      public void setReuseAddress(boolean reuseAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      reuseAddress - whether the server socket reuses addresses
      See Also:
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class AbstractConnector