org.springframework.boot.context.embedded.jetty

Class JettyEmbeddedServletContainerFactory

    • Constructor Detail

      • JettyEmbeddedServletContainerFactory

        public JettyEmbeddedServletContainerFactory(int port)
        Create a new JettyEmbeddedServletContainerFactory that listens for requests using the specified port.
        Parameters:
        port - the port to listen on
      • JettyEmbeddedServletContainerFactory

        public JettyEmbeddedServletContainerFactory(String contextPath,
                                                    int port)
        Create a new JettyEmbeddedServletContainerFactory with the specified context path and port.
        Parameters:
        contextPath - the root context path
        port - the port to listen on
    • Method Detail

      • configureSsl

        protected void configureSsl(org.eclipse.jetty.util.ssl.SslContextFactory factory,
                                    Ssl ssl)
        Configure the SSL connection.
        Parameters:
        factory - the Jetty SslContextFactory.
        ssl - the ssl details.
      • configureWebAppContext

        protected final void configureWebAppContext(org.eclipse.jetty.webapp.WebAppContext context,
                                                    ServletContextInitializer... initializers)
        Configure the given Jetty WebAppContext for use.
        Parameters:
        context - the context to configure
        initializers - the set of initializers to apply
      • addDefaultServlet

        protected final void addDefaultServlet(org.eclipse.jetty.webapp.WebAppContext context)
        Add Jetty's DefaultServlet to the given WebAppContext.
        Parameters:
        context - the jetty WebAppContext
      • addJspServlet

        protected final void addJspServlet(org.eclipse.jetty.webapp.WebAppContext context)
        Add Jetty's JspServlet to the given WebAppContext.
        Parameters:
        context - the jetty WebAppContext
      • getWebAppContextConfigurations

        protected org.eclipse.jetty.webapp.Configuration[] getWebAppContextConfigurations(org.eclipse.jetty.webapp.WebAppContext webAppContext,
                                                                                          ServletContextInitializer... initializers)
        Return the Jetty Configurations that should be applied to the server.
        Parameters:
        webAppContext - the Jetty WebAppContext
        initializers - the ServletContextInitializers to apply
        Returns:
        configurations to apply
      • postProcessWebAppContext

        protected void postProcessWebAppContext(org.eclipse.jetty.webapp.WebAppContext webAppContext)
        Post process the Jetty WebAppContext before it used with the Jetty Server. Subclasses can override this method to apply additional processing to the WebAppContext.
        Parameters:
        webAppContext - the Jetty WebAppContext
      • setResourceLoader

        public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
        Specified by:
        setResourceLoader in interface org.springframework.context.ResourceLoaderAware
      • setUseForwardHeaders

        public void setUseForwardHeaders(boolean useForwardHeaders)
        Set if x-forward-* headers should be processed.
        Parameters:
        useForwardHeaders - if x-forward headers should be used
        Since:
        1.3.0
      • setAcceptors

        public void setAcceptors(int acceptors)
        Set the number of acceptor threads to use.
        Parameters:
        acceptors - the number of acceptor threads to use
        Since:
        1.4.0
      • setSelectors

        public void setSelectors(int selectors)
        Set the number of selector threads to use.
        Parameters:
        selectors - the number of selector threads to use
        Since:
        1.4.0
      • setServerCustomizers

        public void setServerCustomizers(Collection<? extends JettyServerCustomizer> customizers)
        Sets JettyServerCustomizers that will be applied to the Server before it is started. Calling this method will replace any existing configurations.
        Parameters:
        customizers - the Jetty customizers to apply
      • getServerCustomizers

        public Collection<JettyServerCustomizer> getServerCustomizers()
        Returns a mutable collection of Jetty Configurations that will be applied to the WebAppContext before the server is created.
        Returns:
        the Jetty Configurations
      • addServerCustomizers

        public void addServerCustomizers(JettyServerCustomizer... customizers)
        Add JettyServerCustomizers that will be applied to the Server before it is started.
        Parameters:
        customizers - the customizers to add
      • setConfigurations

        public void setConfigurations(Collection<? extends org.eclipse.jetty.webapp.Configuration> configurations)
        Sets Jetty Configurations that will be applied to the WebAppContext before the server is created. Calling this method will replace any existing configurations.
        Parameters:
        configurations - the Jetty configurations to apply
      • getConfigurations

        public Collection<org.eclipse.jetty.webapp.Configuration> getConfigurations()
        Returns a mutable collection of Jetty Configurations that will be applied to the WebAppContext before the server is created.
        Returns:
        the Jetty Configurations
      • addConfigurations

        public void addConfigurations(org.eclipse.jetty.webapp.Configuration... configurations)
        Add Configurations that will be applied to the WebAppContext before the server is started.
        Parameters:
        configurations - the configurations to add
      • getThreadPool

        public org.eclipse.jetty.util.thread.ThreadPool getThreadPool()
        Returns a Jetty ThreadPool that should be used by the Server.
        Returns:
        a Jetty ThreadPool or null
      • setThreadPool

        public void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
        Set a Jetty ThreadPool that should be used by the Server. If set to null (default), the Server creates a ThreadPool implicitly.
        Parameters:
        threadPool - a Jetty ThreadPool to be used

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.