Class UnixDomainServerConnector

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

@ManagedObject public class UnixDomainServerConnector extends AbstractConnector

A Connector implementation for Unix-Domain server socket channels.

UnixDomainServerConnector "listens" to a Unix-Domain path and behaves ServerConnector with respect to acceptors, selectors and connection factories.

Important: the unix-domain path must be less than 108 bytes. This limit is set by the way Unix-Domain sockets work at the OS level.

  • Field Details

    • MAX_UNIX_DOMAIN_PATH_LENGTH

      public static final int MAX_UNIX_DOMAIN_PATH_LENGTH
      See Also:
  • Constructor Details

  • Method Details

    • newSelectorManager

      protected SelectorManager newSelectorManager(Executor executor, Scheduler scheduler, int selectors)
    • getUnixDomainPath

      @ManagedAttribute("The Unix-Domain path this connector listens to") public Path getUnixDomainPath()
    • setUnixDomainPath

      public void setUnixDomainPath(Path unixDomainPath)
    • isInheritChannel

      @ManagedAttribute("Whether this connector uses a server channel inherited from the JVM") public boolean isInheritChannel()
    • setInheritChannel

      public void setInheritChannel(boolean inheritChannel)
    • getAcceptQueueSize

      @ManagedAttribute("The accept queue size (backlog) for the server socket") public int getAcceptQueueSize()
    • setAcceptQueueSize

      public void setAcceptQueueSize(int acceptQueueSize)
    • getAcceptedReceiveBufferSize

      @ManagedAttribute("The SO_RCVBUF option for accepted sockets") public int getAcceptedReceiveBufferSize()
    • setAcceptedReceiveBufferSize

      public void setAcceptedReceiveBufferSize(int acceptedReceiveBufferSize)
    • getAcceptedSendBufferSize

      @ManagedAttribute("The SO_SNDBUF option for accepted sockets") public int getAcceptedSendBufferSize()
    • setAcceptedSendBufferSize

      public void setAcceptedSendBufferSize(int acceptedSendBufferSize)
    • getLocalSocketAddress

      public SocketAddress getLocalSocketAddress()
    • doStart

      protected void doStart() throws Exception
      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
      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
    • accept

      protected void accept(int acceptorID) throws IOException
      Specified by:
      accept in class AbstractConnector
      Throws:
      IOException
    • configure

      protected void configure(SocketChannel channel) throws IOException
      Throws:
      IOException
    • getTransport

      public Object getTransport()
      Description copied from interface: Connector
      Get the underlying socket, channel, buffer etc. for the connector..
      Returns:
      the underlying socket, channel, buffer etc. for the connector.
    • setAccepting

      public void setAccepting(boolean accepting)
      Overrides:
      setAccepting in class AbstractConnector
    • toString

      public String toString()
      Overrides:
      toString in class AbstractConnector