org.springframework.boot.web.embedded.tomcat

Class TomcatServletWebServerFactory

    • Field Detail

      • DEFAULT_PROTOCOL

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

      • TomcatServletWebServerFactory

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

        public TomcatServletWebServerFactory(String contextPath,
                                             int port)
        Create a new TomcatServletWebServerFactory 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)
      • 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's used with the Tomcat Server. Subclasses can override this method to apply additional processing to the Context.
        Parameters:
        context - the Tomcat Context
      • getTomcatWebServer

        protected TomcatWebServer getTomcatWebServer(org.apache.catalina.startup.Tomcat tomcat)
        Factory method called to create the TomcatWebServer. Subclasses can override this method to return a different TomcatWebServer or apply additional processing to the Tomcat server.
        Parameters:
        tomcat - the Tomcat server.
        Returns:
        a new TomcatWebServer instance
      • setResourceLoader

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

        public Set<String> getTldSkipPatterns()
        Returns a mutable set of the patterns that match jars to ignore for TLD scanning.
        Returns:
        the list of jars to ignore for TLD scanning
      • setTldSkipPatterns

        public void setTldSkipPatterns(Collection<String> patterns)
        Set the patterns that match jars to ignore for TLD scanning. See Tomcat's catalina.properties for typical values. Defaults to a list drawn from that source.
        Parameters:
        patterns - the jar patterns to skip when scanning for TLDs etc
      • addTldSkipPatterns

        public void addTldSkipPatterns(String... patterns)
        Add patterns that match jars to ignore for TLD scanning. See Tomcat's catalina.properties for typical values.
        Parameters:
        patterns - the additional jar patterns 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 engine valves that will be applied
      • 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
      • 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 context 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 context lifecycle 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
      • 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
      • 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
      • getUriEncoding

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

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