Class UnixSocketConnector

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Connector, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle

    @ManagedObject("Connector using UNIX Socket")
    public class UnixSocketConnector
    extends org.eclipse.jetty.server.AbstractConnector
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  UnixSocketConnector.UnixSocketConnectorManager  
      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

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

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

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

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      UnixSocketConnector​(org.eclipse.jetty.server.Server server)
      HTTP Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, int selectors)
      HTTP Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, int selectors, org.eclipse.jetty.server.ConnectionFactory... factories)
      HTTP Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, int selectors, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
      HTTP Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool bufferPool, int selectors, org.eclipse.jetty.server.ConnectionFactory... factories)
      Generic Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.ConnectionFactory... factories)
      Generic Server Connection with default configuration.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
      HTTP Server Connection.
      UnixSocketConnector​(org.eclipse.jetty.server.Server server, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, org.eclipse.jetty.server.ConnectionFactory... factories)
      Generic SSL Server Connection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(int acceptorID)  
      protected void accepted​(jnr.unixsocket.UnixSocketChannel channel)  
      void close()  
      protected void doStart()  
      protected void doStop()  
      int getAcceptQueueSize()  
      boolean getReuseAddress()  
      org.eclipse.jetty.io.SelectorManager getSelectorManager()  
      Object getTransport()  
      String getUnixSocket()  
      boolean isOpen()  
      protected UnixSocketEndPoint newEndPoint​(SelectableChannel channel, org.eclipse.jetty.io.ManagedSelector selector, SelectionKey key)  
      protected org.eclipse.jetty.io.SelectorManager newSelectorManager​(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, int selectors)  
      void open()  
      void setAcceptQueueSize​(int acceptQueueSize)  
      void setReuseAddress​(boolean reuseAddress)  
      void setUnixSocket​(String filename)  
      Future<Void> shutdown()  
      String toString()  
      • Methods inherited from class org.eclipse.jetty.server.AbstractConnector

        addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, handleAcceptFailure, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanage
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dump, dump
      • Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

        addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
    • Constructor Detail

      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server)
        HTTP Server Connection.

        Construct a ServerConnector with a private instance of HttpConnectionFactory as the only factory.

        Parameters:
        server - The Server this connector will accept connection for.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("selectors")
                                   int selectors)
        HTTP Server Connection.

        Construct a ServerConnector with a private instance of HttpConnectionFactory as the only factory.

        Parameters:
        server - The Server this connector will accept connection for.
        selectors - the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("selectors")
                                   int selectors,
                                   @Name("factories")
                                   org.eclipse.jetty.server.ConnectionFactory... factories)
        HTTP Server Connection.

        Construct a ServerConnector with a private instance of HttpConnectionFactory as the only factory.

        Parameters:
        server - The Server this connector will accept connection for.
        selectors - the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
        factories - Zero or more ConnectionFactory instances used to create and configure connections.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("factories")
                                   org.eclipse.jetty.server.ConnectionFactory... factories)
        Generic Server Connection with default configuration.

        Construct a Server Connector with the passed Connection factories.

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

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("sslContextFactory")
                                   org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
        HTTP Server Connection.

        Construct a ServerConnector with a private instance of HttpConnectionFactory as the primary protocol

        .
        Parameters:
        server - The Server this connector will accept connection for.
        sslContextFactory - If non null, then a SslConnectionFactory is instantiated and prepended to the list of HTTP Connection Factory.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("selectors")
                                   int selectors,
                                   @Name("sslContextFactory")
                                   org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
        HTTP Server Connection.

        Construct a ServerConnector with a private instance of HttpConnectionFactory as the primary protocol

        .
        Parameters:
        server - The Server this connector will accept connection for.
        sslContextFactory - If non null, then a SslConnectionFactory is instantiated and prepended to the list of HTTP Connection Factory.
        selectors - the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("sslContextFactory")
                                   org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory,
                                   @Name("factories")
                                   org.eclipse.jetty.server.ConnectionFactory... factories)
        Generic SSL Server Connection.
        Parameters:
        server - The Server this connector will accept connection for.
        sslContextFactory - If non null, then a SslConnectionFactory is instantiated and prepended to the list of ConnectionFactories, with the first factory being the default protocol for the SslConnectionFactory.
        factories - Zero or more ConnectionFactory instances used to create and configure connections.
      • UnixSocketConnector

        public UnixSocketConnector​(@Name("server")
                                   org.eclipse.jetty.server.Server server,
                                   @Name("executor")
                                   Executor executor,
                                   @Name("scheduler")
                                   org.eclipse.jetty.util.thread.Scheduler scheduler,
                                   @Name("bufferPool")
                                   org.eclipse.jetty.io.ByteBufferPool bufferPool,
                                   @Name("selectors")
                                   int selectors,
                                   @Name("factories")
                                   org.eclipse.jetty.server.ConnectionFactory... factories)
        Generic Server Connection.
        Parameters:
        server - The server this connector will be accept connection for.
        executor - An executor used to run tasks for handling requests, acceptors and selectors. If null then use the servers executor
        scheduler - A scheduler used to schedule timeouts. If null then use the servers scheduler
        bufferPool - A ByteBuffer pool used to allocate buffers. If null then create a private pool with default configuration.
        selectors - the number of selector threads, or <=0 for a default value(1). Selectors notice and schedule established connection that can make IO progress.
        factories - Zero or more ConnectionFactory instances used to create and configure connections.
    • Method Detail

      • getUnixSocket

        @ManagedAttribute
        public String getUnixSocket()
      • setUnixSocket

        public void setUnixSocket​(String filename)
      • newSelectorManager

        protected org.eclipse.jetty.io.SelectorManager newSelectorManager​(Executor executor,
                                                                          org.eclipse.jetty.util.thread.Scheduler scheduler,
                                                                          int selectors)
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.eclipse.jetty.server.AbstractConnector
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.eclipse.jetty.server.AbstractConnector
        Throws:
        Exception
      • isOpen

        public boolean isOpen()
      • shutdown

        public Future<Void> shutdown()
        Specified by:
        shutdown in interface org.eclipse.jetty.util.component.Graceful
        Overrides:
        shutdown in class org.eclipse.jetty.server.AbstractConnector
      • close

        public void close()
      • accept

        public void accept​(int acceptorID)
                    throws IOException
        Specified by:
        accept in class org.eclipse.jetty.server.AbstractConnector
        Throws:
        IOException
      • accepted

        protected void accepted​(jnr.unixsocket.UnixSocketChannel channel)
                         throws IOException
        Throws:
        IOException
      • getSelectorManager

        public org.eclipse.jetty.io.SelectorManager getSelectorManager()
      • getTransport

        public Object getTransport()
      • getAcceptQueueSize

        @ManagedAttribute("Accept Queue size")
        public int getAcceptQueueSize()
        Returns:
        the accept queue size
      • setAcceptQueueSize

        public void setAcceptQueueSize​(int acceptQueueSize)
        Parameters:
        acceptQueueSize - the accept queue size (also known as accept backlog)
      • setReuseAddress

        public void setReuseAddress​(boolean reuseAddress)
        Parameters:
        reuseAddress - whether the server socket reuses addresses
        See Also:
        ServerSocket.setReuseAddress(boolean)
      • toString

        public String toString()
        Overrides:
        toString in class org.eclipse.jetty.server.AbstractConnector