Package hudson

Class WebAppMain

java.lang.Object
hudson.WebAppMain
All Implemented Interfaces:
jakarta.servlet.ServletContextListener, EventListener

public class WebAppMain extends Object implements jakarta.servlet.ServletContextListener
Entry point when Hudson is used as a webapp.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • WebAppMain

      public WebAppMain()
  • Method Details

    • getDefaultRingBufferSize

      public static int getDefaultRingBufferSize()
      This getter returns the int DEFAULT_RING_BUFFER_SIZE from the class RingBufferLogHandler from a static context. Exposes access from RingBufferLogHandler.DEFAULT_RING_BUFFER_SIZE to WebAppMain. Written for the requirements of JENKINS-50669
      Returns:
      int This returns DEFAULT_RING_BUFFER_SIZE
      Since:
      2.259
      See Also:
    • contextInitialized

      public void contextInitialized(jakarta.servlet.ServletContextEvent event)
      Creates the sole instance of Jenkins and register it to the ServletContext.
      Specified by:
      contextInitialized in interface jakarta.servlet.ServletContextListener
    • joinInit

      public void joinInit() throws InterruptedException
      Throws:
      InterruptedException
    • installExpressionFactory

      public static void installExpressionFactory(jakarta.servlet.ServletContextEvent event)
      Since:
      2.475
    • installExpressionFactory

      @Deprecated public static void installExpressionFactory(javax.servlet.ServletContextEvent event)
    • getHomeDir

      public WebAppMain.FileAndDescription getHomeDir(jakarta.servlet.ServletContextEvent event)
      Determines the home directory for Jenkins.

      We look for a setting that affects the smallest scope first, then bigger ones later.

      People make configuration mistakes, so we are trying to be nice with those by doing String.trim().

      Returns:
      the File alongside with some description to help the user troubleshoot issues
    • contextDestroyed

      public void contextDestroyed(jakarta.servlet.ServletContextEvent event)
      Specified by:
      contextDestroyed in interface jakarta.servlet.ServletContextListener