org.springframework.boot.web.embedded.tomcat

Class TomcatReactiveWebServerFactory

    • Field Detail

      • DEFAULT_PROTOCOL

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

      • TomcatReactiveWebServerFactory

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

      • getWebServer

        public WebServer getWebServer(org.springframework.http.server.reactive.HttpHandler httpHandler)
        Description copied from interface: ReactiveWebServerFactory
        Gets a new fully configured but paused WebServer instance. Clients should not be able to connect to the returned server until WebServer.start() is called (which happens when the ApplicationContext has been fully refreshed).
        Specified by:
        getWebServer in interface ReactiveWebServerFactory
        Parameters:
        httpHandler - the HTTP handler in charge of processing requests
        Returns:
        a fully configured and started WebServer
        See Also:
        WebServer.stop()
      • prepareContext

        protected void prepareContext(org.apache.catalina.Host host,
                                      org.springframework.http.server.reactive.TomcatHttpHandlerAdapter servlet)
      • configureContext

        protected void configureContext(org.apache.catalina.Context context)
        Configure the Tomcat Context.
        Parameters:
        context - the Tomcat context
      • customizeConnector

        protected void customizeConnector(org.apache.catalina.connector.Connector connector)
      • 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
      • setTomcatProtocolHandlerCustomizers

        public void setTomcatProtocolHandlerCustomizers(Collection<? extends TomcatProtocolHandlerCustomizer<?>> tomcatProtocolHandlerCustomizers)
        Set TomcatProtocolHandlerCustomizers that should be applied to the Tomcat Connector. Calling this method will replace any existing customizers.
        Parameters:
        tomcatProtocolHandlerCustomizers - the customizers to set
        Since:
        2.2.0
      • 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
        Since:
        2.2.0
      • 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
        Since:
        2.2.0
      • getEngineValves

        public List<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
      • setUriEncoding

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

        public Charset getUriEncoding()
        Returns the character encoding to use for URL decoding.
        Returns:
        the URI encoding
      • 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
      • 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
      • setProtocol

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

        public void setDisableMBeanRegistry(boolean disableMBeanRegistry)
        Set whether the factory should disable Tomcat's MBean registry prior to creating the server.
        Parameters:
        disableMBeanRegistry - whether to disable the MBean registry
        Since:
        2.2.0

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