java.lang.Object
fiftyone.pipeline.developerexamples.web.shared.EmbedTomcat

public class EmbedTomcat extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.apache.catalina.startup.Tomcat
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    runServlet(javax.servlet.http.HttpServlet servlet, String workingDir, String urlPattern, int port)
    Utility to run a webapp in Tomcat - wait and then shut down
    static void
    runWebApp(String pathname, String workingDir, int port)
    Utility to run a servlet in Tomcat at the server root address - wait and then shut down
    static org.apache.catalina.Context
    startTomcat(String servletName, String urlPattern, javax.servlet.http.HttpServlet servlet, int port)
    Utility to start Tomcat with the servlet supplied
    static void
    Utility to shut Tomcat down

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tomcat

      public static org.apache.catalina.startup.Tomcat tomcat
  • Constructor Details

    • EmbedTomcat

      public EmbedTomcat()
  • Method Details

    • startTomcat

      public static org.apache.catalina.Context startTomcat(String servletName, String urlPattern, javax.servlet.http.HttpServlet servlet, int port) throws org.apache.catalina.LifecycleException, IOException
      Utility to start Tomcat with the servlet supplied
      Parameters:
      servletName - a name
      urlPattern - a mapping for the addresses the servlet will respond to
      servlet - an instantiated servlet
      Returns:
      a server context
      Throws:
      org.apache.catalina.LifecycleException
      IOException
    • stopTomcat

      public static void stopTomcat()
      Utility to shut Tomcat down
    • runWebApp

      public static void runWebApp(String pathname, String workingDir, int port) throws org.apache.catalina.LifecycleException
      Utility to run a servlet in Tomcat at the server root address - wait and then shut down
      Parameters:
      pathname - path to the webapp folder from project root
      workingDir - where Tomcat should put its temp files etc
      port - the port to listen on
      Throws:
      org.apache.catalina.LifecycleException
    • runServlet

      public static void runServlet(javax.servlet.http.HttpServlet servlet, String workingDir, String urlPattern, int port) throws org.apache.catalina.LifecycleException
      Utility to run a webapp in Tomcat - wait and then shut down
      Parameters:
      servlet - a servlet
      workingDir - where Tomcat should put its temp files etc
      urlPattern - where servlet should be releative to server root
      port - the port to listen on
      Throws:
      org.apache.catalina.LifecycleException