org.eclipse.jetty.server

Class Server

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


    public class Serverextends HandlerWrapperimplements Attributes
    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.
    Apache XBean:
    description="Creates an embedded Jetty web server"
    • Method Detail

      • getVersion

        public static String getVersion()
      • getContainer

        public Container getContainer()
        Returns:
        Returns the container.
      • getStopAtShutdown

        public boolean getStopAtShutdown()
      • setStopAtShutdown

        public void setStopAtShutdown(boolean stop)
      • getConnectors

        public Connector[] getConnectors()
        Returns:
        Returns the connectors.
      • addConnector

        public void addConnector(Connector connector)
      • setConnectors

        public void setConnectors(Connector[] connectors)
        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.
      • getThreadPool

        public ThreadPool getThreadPool()
        Returns:
        Returns the threadPool.
      • setThreadPool

        public void setThreadPool(ThreadPool threadPool)
        Parameters:
        threadPool - The threadPool to set.
      • setDumpAfterStart

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

        public void setDumpBeforeStop(boolean dumpBeforeStop)
        Parameters:
        dumpBeforeStop - true if AggregateLifeCycle.dumpStdErr() is called before stopping
      • getSessionIdManager

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

        public void setSessionIdManager(SessionIdManager sessionIdManager)
        Parameters:
        sessionIdManager - The sessionIdManager to set.
      • setSendServerVersion

        public void setSendServerVersion(boolean sendServerVersion)
      • getSendServerVersion

        public boolean getSendServerVersion()
      • setSendDateHeader

        public void setSendDateHeader(boolean sendDateHeader)
        Parameters:
        sendDateHeader -
      • getSendDateHeader

        public boolean getSendDateHeader()
      • getMaxCookieVersion

        @Deprecatedpublic int getMaxCookieVersion()
        Deprecated. 
      • setMaxCookieVersion

        @Deprecatedpublic void setMaxCookieVersion(int maxCookieVersion)
        Deprecated. 
      • addLifeCycle

        @Deprecatedpublic void addLifeCycle(LifeCycle c)
        Deprecated. Use addBean(Object)
        Add a LifeCycle object to be started/stopped along with the Server.
        Parameters:
        c -
      • addBean

        public boolean addBean(Object o)
        Add an associated bean. The bean will be added to the servers Container and if it is a LifeCycle instance, it will be started/stopped along with the Server. Any beans that are also Destroyable, will be destroyed with the server.
        Overrides:
        addBean in class AggregateLifeCycle
        Parameters:
        o - the bean object to add
      • getGracefulShutdown

        public int getGracefulShutdown()
        Returns:
        the graceful
      • setGracefulShutdown

        public void setGracefulShutdown(int timeoutMS)
        Set graceful shutdown timeout. If set, the internal doStop() method will not immediately stop the server. Instead, all Connectors will be closed so that new connections will not be accepted and all handlers that implement Server.Graceful will be put into the shutdown mode so that no new requests will be accepted, but existing requests can complete. The server will then wait the configured timeout before stopping.
        Parameters:
        timeoutMS - the milliseconds to wait for existing request to complete before stopping the server.
      • isUncheckedPrintWriter

        public boolean isUncheckedPrintWriter()
      • setUncheckedPrintWriter

        public void setUncheckedPrintWriter(boolean unchecked)

Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14