Class AntWebAppContext

All Implemented Interfaces:
Handler, HandlerContainer, Attributes, ClassVisibilityChecker, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, Graceful, LifeCycle, WebAppClassLoader.Context

public class AntWebAppContext extends WebAppContext
Extension of WebAppContext to allow configuration via Ant environment.
  • Field Details

    • DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN

      public static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
      See Also:
  • Constructor Details

    • AntWebAppContext

      public AntWebAppContext(org.apache.tools.ant.Project project) throws Exception
      Default constructor. Takes project as an argument
      Parameters:
      project - the project.
      Throws:
      Exception - if unable to create webapp context
  • Method Details

    • dump

      public static void dump(ClassLoader loader)
    • addAttributes

      public void addAttributes(Attributes atts)
      Adds a new Ant's attributes tag object if it have not been created yet.
      Parameters:
      atts - the attributes
    • addLib

      public void addLib(org.apache.tools.ant.types.FileSet lib)
    • addClasses

      public void addClasses(org.apache.tools.ant.types.FileSet classes)
    • newServletHandler

      protected ServletHandler newServletHandler()
      Overrides:
      newServletHandler in class ServletContextHandler
    • setJettyEnvXml

      public void setJettyEnvXml(File jettyEnvXml)
    • getJettyEnvXml

      public File getJettyEnvXml()
    • getLibraries

      public List<File> getLibraries()
    • addScanTargets

      public void addScanTargets(org.apache.tools.ant.types.FileSet scanTargets)
    • getScanTargetFiles

      public List<File> getScanTargetFiles()
    • getScanFiles

      public List<File> getScanFiles()
    • isScanned

      public boolean isScanned(File file)
    • initScanFiles

      public List<File> initScanFiles()
    • setWar

      public void setWar(String path)
      Description copied from class: WebAppContext
      Set the war of the webapp. From this value a ContextHandler.setResourceBase(String) value is computed by WebInfConfiguration, which may be changed from the war URI by unpacking and/or copying.
      Overrides:
      setWar in class WebAppContext
      Parameters:
      path - The war to set as a file name or URL.
    • doStart

      public void doStart()
      Description copied from class: ContainerLifeCycle
      Starts the managed lifecycle beans in the order they were added.
      Overrides:
      doStart in class WebAppContext
    • doStop

      public void doStop()
      Description copied from class: ContainerLifeCycle
      Stops the managed lifecycle beans in the reverse order they were added.
      Overrides:
      doStop in class ServletContextHandler
    • getClassPathFiles

      public List<File> getClassPathFiles()
      Returns:
      a list of classpath files (libraries and class directories).
    • getLibrariesConfiguration

      public FileMatchingConfiguration getLibrariesConfiguration()
      Returns:
      a FileMatchingConfiguration object describing the configuration of all libraries added to this particular web app (both classes and libraries).
    • getContextXml

      public File getContextXml()
    • setContextXml

      public void setContextXml(File contextXml)