org.springframework.boot.context.embedded.tomcat

Class TomcatEmbeddedServletContainerFactory

    • Field Detail

      • DEFAULT_PROTOCOL

        public static final String DEFAULT_PROTOCOL
        The class name of default protocol used.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TomcatEmbeddedServletContainerFactory

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

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

      • customizeConnector

        protected void customizeConnector(org.apache.catalina.connector.Connector connector)
      • configureSsl

        protected void configureSsl(org.apache.coyote.http11.AbstractHttp11JsseProtocol<?> protocol,
                                    Ssl ssl)
        Configure Tomcat's AbstractHttp11JsseProtocol for SSL.
        Parameters:
        protocol - the protocol
        ssl - the ssl details
      • configureSslStoreProvider

        protected void configureSslStoreProvider(org.apache.coyote.http11.AbstractHttp11JsseProtocol<?> protocol,
                                                 SslStoreProvider sslStoreProvider)
      • configureContext

        protected void configureContext(org.apache.catalina.Context context,
                                        ServletContextInitializer[] initializers)
        Configure the Tomcat Context.
        Parameters:
        context - the Tomcat context
        initializers - initializers to apply
      • postProcessContext

        protected void postProcessContext(org.apache.catalina.Context context)
        Post process the Tomcat Context before it used with the Tomcat Server. Subclasses can override this method to apply additional processing to the Context.
        Parameters:
        context - the Tomcat Context
      • setResourceLoader

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

        public void setBaseDirectory(File baseDirectory)
        Set the Tomcat base directory. If not specified a temporary directory will be used.
        Parameters:
        baseDirectory - the tomcat base directory
      • setTldSkip

        public void setTldSkip(String tldSkip)
        A comma-separated list of jars to ignore for TLD scanning. See Tomcat's catalina.properties for typical values. Defaults to a list drawn from that source.
        Parameters:
        tldSkip - the jars to skip when scanning for TLDs etc
      • setProtocol

        public void setProtocol(String protocol)
        The Tomcat protocol to use when create the Connector.
        Parameters:
        protocol - the protocol
        See Also:
        Connector.Connector(String)
      • setEngineValves

        public void setEngineValves(Collection<? extends org.apache.catalina.Valve> engineValves)
        Set Valves that should be applied to the Tomcat Engine. Calling this method will replace any existing valves.
        Parameters:
        engineValves - the valves to set
      • getEngineValves

        public Collection<org.apache.catalina.Valve> getEngineValves()
        Returns a mutable collection of the Valves that will be applied to the Tomcat Engine.
        Returns:
        the engineValves the valves that will be applied
      • addEngineValves

        public void addEngineValves(org.apache.catalina.Valve... engineValves)
        Add Valves that should be applied to the Tomcat Engine.
        Parameters:
        engineValves - the valves to add
      • setContextValves

        public void setContextValves(Collection<? extends org.apache.catalina.Valve> contextValves)
        Set Valves that should be applied to the Tomcat Context. Calling this method will replace any existing valves.
        Parameters:
        contextValves - the valves to set
      • getValves

        @Deprecated
        public Collection<org.apache.catalina.Valve> getValves()
        Deprecated. as of 1.4 in favor of getContextValves()
        Returns a mutable collection of the Valves that will be applied to the Tomcat Context.
        Returns:
        the contextValves the valves that will be applied
      • getContextValves

        public Collection<org.apache.catalina.Valve> getContextValves()
        Returns a mutable collection of the Valves that will be applied to the Tomcat Context.
        Returns:
        the contextValves the valves that will be applied
        See Also:
        getEngineValves()
      • addContextValves

        public void addContextValves(org.apache.catalina.Valve... contextValves)
        Add Valves that should be applied to the Tomcat Context.
        Parameters:
        contextValves - the valves to add
      • setContextLifecycleListeners

        public void setContextLifecycleListeners(Collection<? extends org.apache.catalina.LifecycleListener> contextLifecycleListeners)
        Set LifecycleListeners that should be applied to the Tomcat Context . Calling this method will replace any existing listeners.
        Parameters:
        contextLifecycleListeners - the listeners to set
      • getContextLifecycleListeners

        public Collection<org.apache.catalina.LifecycleListener> getContextLifecycleListeners()
        Returns a mutable collection of the LifecycleListeners that will be applied to the Tomcat Context .
        Returns:
        the contextLifecycleListeners the listeners that will be applied
      • addContextLifecycleListeners

        public void addContextLifecycleListeners(org.apache.catalina.LifecycleListener... contextLifecycleListeners)
        Add LifecycleListeners that should be added to the Tomcat Context.
        Parameters:
        contextLifecycleListeners - the listeners to add
      • setTomcatContextCustomizers

        public void setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer> tomcatContextCustomizers)
        Set TomcatContextCustomizers that should be applied to the Tomcat Context . Calling this method will replace any existing customizers.
        Parameters:
        tomcatContextCustomizers - the customizers to set
      • addContextCustomizers

        public void addContextCustomizers(TomcatContextCustomizer... tomcatContextCustomizers)
        Add TomcatContextCustomizers that should be added to the Tomcat Context.
        Parameters:
        tomcatContextCustomizers - the customizers to add
      • setTomcatConnectorCustomizers

        public void setTomcatConnectorCustomizers(Collection<? extends TomcatConnectorCustomizer> tomcatConnectorCustomizers)
        Set TomcatConnectorCustomizers that should be applied to the Tomcat Connector . Calling this method will replace any existing customizers.
        Parameters:
        tomcatConnectorCustomizers - the customizers to set
      • addConnectorCustomizers

        public void addConnectorCustomizers(TomcatConnectorCustomizer... tomcatConnectorCustomizers)
        Add TomcatContextCustomizers that should be added to the Tomcat Connector.
        Parameters:
        tomcatConnectorCustomizers - the customizers to add
      • addAdditionalTomcatConnectors

        public void addAdditionalTomcatConnectors(org.apache.catalina.connector.Connector... connectors)
        Add Connectors in addition to the default connector, e.g. for SSL or AJP
        Parameters:
        connectors - the connectors to add
      • getAdditionalTomcatConnectors

        public List<org.apache.catalina.connector.Connector> getAdditionalTomcatConnectors()
        Returns a mutable collection of the Connectors that will be added to the Tomcat.
        Returns:
        the additionalTomcatConnectors
      • setUriEncoding

        public void setUriEncoding(Charset uriEncoding)
        Set the character encoding to use for URL decoding. If not specified 'UTF-8' will be used.
        Parameters:
        uriEncoding - the uri encoding to set
      • getUriEncoding

        public Charset getUriEncoding()
        Returns the character encoding to use for URL decoding.
        Returns:
        the URI encoding
      • setBackgroundProcessorDelay

        public void setBackgroundProcessorDelay(int delay)
        Sets the background processor delay in seconds.
        Parameters:
        delay - the delay in seconds
        Since:
        1.4.1

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