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

    • LOG

      private static final Logger LOG
    • ANT_WEB_INF_CONFIGURATION

      public static final AntWebInfConfiguration ANT_WEB_INF_CONFIGURATION
    • WEB_XML_CONFIGURATION

      public static final WebXmlConfiguration WEB_XML_CONFIGURATION
    • META_INF_CONFIGURATION

      public static final MetaInfConfiguration META_INF_CONFIGURATION
    • FRAGMENT_CONFIGURATION

      public static final FragmentConfiguration FRAGMENT_CONFIGURATION
    • ENV_CONFIGURATION

      public static final EnvConfiguration ENV_CONFIGURATION
    • PLUS_CONFIGURATION

      public static final PlusConfiguration PLUS_CONFIGURATION
    • ANNOTATION_CONFIGURATION

      public static final AnnotationConfiguration ANNOTATION_CONFIGURATION
    • JETTY_WEB_XML_CONFIGURATION

      public static final JettyWebXmlConfiguration JETTY_WEB_XML_CONFIGURATION
    • DEFAULT_CONFIGURATIONS

      public static final Configuration[] DEFAULT_CONFIGURATIONS
    • DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN

      public static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
      See Also:
    • jettyEnvXml

      private File jettyEnvXml
      Location of jetty-env.xml file.
    • libraries

      private List libraries
      List of web application libraries.
    • classes

      private List classes
      List of web application class directories.
    • contextXml

      private File contextXml
      context xml file to apply to the webapp
    • scanTargets

      private org.apache.tools.ant.types.FileSet scanTargets
      List of extra scan targets for this web application.
    • attributes

      private Attributes attributes
      context attributes to set
    • project

      private org.apache.tools.ant.Project project
    • scanFiles

      private List<File> scanFiles
    • extraScanTargetsConfiguration

      private FileMatchingConfiguration extraScanTargetsConfiguration
      Extra scan targets.
    • librariesConfiguration

      private FileMatchingConfiguration librariesConfiguration
  • 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 getLibraries()
    • addScanTargets

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

      public List 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
      See Also:
    • 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 WebAppContext
      See Also:
    • 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)