Class EmbedTomcat
java.lang.Object
fiftyone.pipeline.developerexamples.web.shared.EmbedTomcat
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidrunServlet(javax.servlet.http.HttpServlet servlet, String workingDir, String urlPattern, int port) Utility to run a webapp in Tomcat - wait and then shut downstatic voidUtility to run a servlet in Tomcat at the server root address - wait and then shut downstatic org.apache.catalina.ContextstartTomcat(String servletName, String urlPattern, javax.servlet.http.HttpServlet servlet, int port) Utility to start Tomcat with the servlet suppliedstatic voidUtility to shut Tomcat down
-
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 nameurlPattern- a mapping for the addresses the servlet will respond toservlet- an instantiated servlet- Returns:
- a server context
- Throws:
org.apache.catalina.LifecycleExceptionIOException
-
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 rootworkingDir- where Tomcat should put its temp files etcport- 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 servletworkingDir- where Tomcat should put its temp files etcurlPattern- where servlet should be releative to server rootport- the port to listen on- Throws:
org.apache.catalina.LifecycleException
-