Class BasicTomcatServerFactory

java.lang.Object
org.apache.juneau.microservice.tomcat.BasicTomcatServerFactory
All Implemented Interfaces:
TomcatServerFactory

public class BasicTomcatServerFactory extends Object implements TomcatServerFactory
Basic implementation of a Tomcat server factory.

Builds a programmatic Tomcat instance with the supplied Catalina base directory and a single root context mounted at "" with the base directory as its doc-base. Auto-deployment is disabled (servlets are mounted explicitly by TomcatServerComponent).

See Also:
  • Constructor Details

  • Method Details

    • create

      public org.apache.catalina.startup.Tomcat create(File baseDir) throws Exception
      Description copied from interface: TomcatServerFactory
      Create a new initialized embedded Tomcat server.

      The returned server is configured with the specified Catalina base directory and a root context (mounted at "") but is not yet started and has no connector port assigned — the TomcatServerComponent assigns the port and materializes the connector before calling Tomcat.start().

      Specified by:
      create in interface TomcatServerFactory
      Parameters:
      baseDir - The writable Catalina base / work directory to use for this server.
      Returns:
      A newly-created but not-yet-started Tomcat server.
      Throws:
      Exception - Any exception.