Class Server

  • All Implemented Interfaces:
    Handler, HandlerContainer, Attributes, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle

    @ManagedObject("Jetty HTTP Servlet server")
    @Deprecated(since="2021-05-27")
    public class Server
    extends HandlerWrapper
    implements Attributes
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
    Jetty HTTP Servlet Server. This class is the main class for the Jetty HTTP Servlet server. It aggregates Connectors (HTTP request receivers) and request Handlers. The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods to run jobs that will eventually call the handle method.
    • Constructor Detail

      • Server

        public Server()
        Deprecated.
      • Server

        public Server​(@Name("port")
                      int port)
        Deprecated.
        Convenience constructor Creates server and a ServerConnector at the passed port.
        Parameters:
        port - The port of a network HTTP connector (or 0 for a randomly allocated port).
        See Also:
        NetworkConnector.getLocalPort()
      • Server

        public Server​(@Name("address")
                      java.net.InetSocketAddress addr)
        Deprecated.
        Convenience constructor

        Creates server and a ServerConnector at the passed address.

        Parameters:
        addr - the inet socket address to create the connector from
      • Server

        public Server​(@Name("threadpool")
                      ThreadPool pool)
        Deprecated.
    • Method Detail

      • getRequestLog

        public RequestLog getRequestLog()
        Deprecated.
      • getErrorHandler

        public ErrorHandler getErrorHandler()
        Deprecated.
      • setRequestLog

        public void setRequestLog​(RequestLog requestLog)
        Deprecated.
      • setErrorHandler

        public void setErrorHandler​(ErrorHandler errorHandler)
        Deprecated.
      • getVersion

        @ManagedAttribute("version of this server")
        public static java.lang.String getVersion()
        Deprecated.
      • getStopAtShutdown

        public boolean getStopAtShutdown()
        Deprecated.
      • setStopAtShutdown

        public void setStopAtShutdown​(boolean stop)
        Deprecated.
        Set stop server at shutdown behaviour.
        Parameters:
        stop - If true, this server instance will be explicitly stopped when the JVM is shutdown. Otherwise the JVM is stopped with the server running.
        See Also:
        Runtime.addShutdownHook(Thread), ShutdownThread
      • addConnector

        public void addConnector​(Connector connector)
        Deprecated.
      • setConnectors

        public void setConnectors​(Connector[] connectors)
        Deprecated.
        Set the connectors for this server. Each connector has this server set as it's ThreadPool and its Handler.
        Parameters:
        connectors - The connectors to set.
      • addBeanToAllConnectors

        public void addBeanToAllConnectors​(java.lang.Object bean)
        Deprecated.
        Add a bean to all connectors on the server. If the bean is an instance of Connection.Listener it will also be registered as a listener on all connections accepted by the connectors.
        Parameters:
        bean - the bean to be added.
      • getThreadPool

        @ManagedAttribute("the server thread pool")
        public ThreadPool getThreadPool()
        Deprecated.
        Returns:
        Returns the threadPool.
      • setDumpAfterStart

        public void setDumpAfterStart​(boolean dumpAfterStart)
        Deprecated.
        Parameters:
        dumpAfterStart - true if ContainerLifeCycle.dumpStdErr() is called after starting
      • setDumpBeforeStop

        public void setDumpBeforeStop​(boolean dumpBeforeStop)
        Deprecated.
        Parameters:
        dumpBeforeStop - true if ContainerLifeCycle.dumpStdErr() is called before stopping
      • getDateField

        public HttpField getDateField()
        Deprecated.
      • join

        public void join()
                  throws java.lang.InterruptedException
        Deprecated.
        Throws:
        java.lang.InterruptedException
      • getSessionIdManager

        public SessionIdManager getSessionIdManager()
        Deprecated.
        Returns:
        Returns the sessionIdManager.
      • setSessionIdManager

        public void setSessionIdManager​(SessionIdManager sessionIdManager)
        Deprecated.
        Parameters:
        sessionIdManager - The sessionIdManager to set.
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Deprecated.
        Specified by:
        getAttribute in interface Attributes
      • getAttributeNames

        public java.util.Enumeration<java.lang.String> getAttributeNames()
        Deprecated.
        Specified by:
        getAttributeNames in interface Attributes
      • getAttributeNameSet

        public java.util.Set<java.lang.String> getAttributeNameSet()
        Deprecated.
        Specified by:
        getAttributeNameSet in interface Attributes
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Deprecated.
        Specified by:
        removeAttribute in interface Attributes
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object attribute)
        Deprecated.
        Specified by:
        setAttribute in interface Attributes
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        Overrides:
        dump in class ContainerLifeCycle
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • main

        public static void main​(java.lang.String... args)
                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception