Class WebAppStarter


  • public class WebAppStarter
    extends Object
    Add, start or stop a webapp. Add to the webapp classpath if specified in webapps.config. Sadly, setting Class-Path in MANIFEST.MF doesn't work for jetty wars. See WebAppConfiguration for more information. but let's just do it in webapps.config. No, wac.addClassPath() does not work. For more info see: http://servlets.com/archive/servlet/ReadMsg?msgId=511113&listName=jetty-support
    Since:
    0.7.12
    Author:
    zzz
    • Constructor Detail

      • WebAppStarter

        public WebAppStarter()
    • Method Detail

      • startWebApp

        public static void startWebApp​(RouterContext ctx,
                                       ContextHandlerCollection server,
                                       String appName,
                                       String warPath)
                                throws Exception
        Adds and starts. Prior to 0.9.28, was not guaranteed to throw on failure. Not for routerconsole.war, it's started in RouterConsoleRunner. As of 0.9.34, the appName will be registered with the PortMapper.
        Throws:
        Exception - just about anything, caller would be wise to catch Throwable
        Since:
        public since 0.9.33, was package private
      • setWebAppConfiguration

        static void setWebAppConfiguration​(WebAppContext wac,
                                           boolean scanAnnotations)
        Parameters:
        scanAnnotations - Should we check for Servlet 3.0 annotations? The war MUST be set to extract (due to Jetty bug), and annotation classes MUST be available
        Since:
        Jetty 9
      • stopWebApp

        public static void stopWebApp​(RouterContext ctx,
                                      String appName)
        Stop it and remove the context. Throws just about anything, caller would be wise to catch Throwable Warning, this will NOT work during shutdown, because the console is already unregistered.
        Since:
        public since 0.9.33, was package private
      • stopWebApp

        static void stopWebApp​(RouterContext ctx,
                               Server s,
                               String appName)
        Stop it and remove the context. Throws just about anything, caller would be wise to catch Throwable
        Since:
        0.9.41
      • isWebAppRunning

        public static boolean isWebAppRunning​(I2PAppContext ctx,
                                              String appName)
        As of 0.9.34, the appName will be registered with the PortMapper, and PortMapper.isRegistered() will be more efficient than this. Warning, this will NOT work during shutdown, because the console is already unregistered.
        Since:
        public since 0.9.33; was package private
      • isWebAppRunning

        static boolean isWebAppRunning​(Server s,
                                       String appName)
        Since:
        0.9.41
      • getWebApp

        static ContextHandler getWebApp​(I2PAppContext ctx,
                                        String appName)
        Warning, this will NOT work during shutdown, because the console is already unregistered.
        Since:
        Jetty 6
      • getConsoleServer

        public static ContextHandlerCollection getConsoleServer​(I2PAppContext ctx)
        See comments in ConfigClientsHandler Warning, this will NOT work during shutdown, because the console is already unregistered.
        Since:
        public since 0.9.33, was package private