Class UndertowServletWebServerFactory

All Implemented Interfaces:
Aware, ConfigurableUndertowWebServerFactory, ConfigurableWebServerFactory, ErrorPageRegistry, ConfigurableServletWebServerFactory, ServletWebServerFactory, WebListenerRegistry, WebServerFactory, ResourceLoaderAware

public class UndertowServletWebServerFactory extends UndertowWebServerFactory implements ConfigurableServletWebServerFactory, ResourceLoaderAware
ServletWebServerFactory that can be used to create UndertowServletWebServers.

Unless explicitly configured otherwise, the factory will create servers that listen for HTTP requests on port 8080.

Since:
4.0.0
Author:
Ivan Sopov, Andy Wilkinson, Marcos Barbero, EddĂș MelĂ©ndez, Scott Frederick
See Also:
  • Constructor Details

    • UndertowServletWebServerFactory

      public UndertowServletWebServerFactory()
      Create a new UndertowServletWebServerFactory instance.
    • UndertowServletWebServerFactory

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

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

    • getDeploymentInfoCustomizers

      public Collection<UndertowDeploymentInfoCustomizer> getDeploymentInfoCustomizers()
      Returns a mutable collection of the UndertowDeploymentInfoCustomizers that will be applied to the Undertow DeploymentInfo.
      Returns:
      the customizers that will be applied
    • setDeploymentInfoCustomizers

      public void setDeploymentInfoCustomizers(Collection<? extends UndertowDeploymentInfoCustomizer> customizers)
      Set UndertowDeploymentInfoCustomizers that should be applied to the Undertow DeploymentInfo. Calling this method will replace any existing customizers.
      Parameters:
      customizers - the customizers to set
    • addDeploymentInfoCustomizers

      public void addDeploymentInfoCustomizers(UndertowDeploymentInfoCustomizer... customizers)
      Add UndertowDeploymentInfoCustomizers that should be used to customize the Undertow DeploymentInfo.
      Parameters:
      customizers - the customizers to add
    • setResourceLoader

      public void setResourceLoader(ResourceLoader resourceLoader)
      Specified by:
      setResourceLoader in interface ResourceLoaderAware
    • isEagerFilterInit

      public boolean isEagerFilterInit()
      Return if filters should be eagerly initialized.
      Returns:
      true if filters are eagerly initialized, otherwise false.
    • setEagerFilterInit

      public void setEagerFilterInit(boolean eagerFilterInit)
      Set whether filters should be eagerly initialized.
      Parameters:
      eagerFilterInit - true if filters are eagerly initialized, otherwise false.
    • isPreservePathOnForward

      public boolean isPreservePathOnForward()
      Return whether the request path should be preserved on forward.
      Returns:
      true if the path should be preserved when a request is forwarded, otherwise false.
    • setPreservePathOnForward

      public void setPreservePathOnForward(boolean preservePathOnForward)
      Set whether the request path should be preserved on forward.
      Parameters:
      preservePathOnForward - true if the path should be preserved when a request is forwarded, otherwise false.
    • getWebServer

      public WebServer getWebServer(ServletContextInitializer... initializers)
      Description copied from interface: ServletWebServerFactory
      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 ServletWebServerFactory
      Parameters:
      initializers - ServletContextInitializers that should be applied as the server starts
      Returns:
      a fully configured and started WebServer
      See Also:
    • getUndertowWebServer

      protected UndertowServletWebServer getUndertowWebServer(io.undertow.Undertow.Builder builder, io.undertow.servlet.api.DeploymentManager manager, int port)
      Factory method called to create the UndertowServletWebServer. Subclasses can override this method to return a different UndertowServletWebServer or apply additional processing to the Undertow.Builder and DeploymentManager used to bootstrap Undertow
      Parameters:
      builder - the builder
      manager - the deployment manager
      port - the port that Undertow should listen on
      Returns:
      a new UndertowServletWebServer instance
    • getSettings

      public ServletWebServerSettings getSettings()
      Specified by:
      getSettings in interface ConfigurableServletWebServerFactory