Class EmbeddedContextConfig

  • All Implemented Interfaces:
    org.apache.catalina.LifecycleListener

    public class EmbeddedContextConfig
    extends org.apache.catalina.startup.ContextConfig
    A custom ContextConfig for use in the Embedded Tomcat container integration for Arquillian.

    This configuration disables processing of a default web.xml (typically "$CATALINA_BASE/conf/web.xml"), as we don't have one. Instead we leverage Tomcat.initWebappDefaults(org.apache.catalina.Context) to apply the equivalent configuration prior to context start.

    This implementation also marks an unpacked WAR for deletion when the context is stopped.

    Author:
    Dan Allen, Ian Brandt
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.catalina.startup.ContextConfig

        org.apache.catalina.startup.ContextConfig.ContextXml
    • Field Summary

      • Fields inherited from class org.apache.catalina.startup.ContextConfig

        authenticators, context, customAuthenticators, defaultWebXml, deploymentCount, DUMMY_LOGIN_CONFIG, handlesTypesAnnotations, handlesTypesNonAnnotations, hostWebXmlCache, initializerClassMap, ok, originalDocBase, sm, typeInitializerMap
    • Constructor Summary

      Constructors 
      Constructor Description
      EmbeddedContextConfig()
      Initialize the context config so to disable processing of the default global web.xml.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void beforeStart()
      Override to apply the equivalent of the stock "$CATALINA_BASE/conf/web.xml" to contexts programmatically.
      protected void fixDocBase()
      Override to assign an internal field that will trigger the removal of the unpacked WAR when the context is closed.
      • Methods inherited from class org.apache.catalina.startup.ContextConfig

        antiLocking, applicationAnnotationsConfig, authenticatorConfig, checkHandlesTypes, configureStart, configureStop, contextConfig, createContextDigester, createWebXml, destroy, generateClassFooter, generateClassHeader, getConfigBasePath, getContextWebXmlSource, getContextXmlJavaSource, getContextXmlPackageName, getDefaultWebXml, getGenerateCode, getGeneratedCodeLocation, getGeneratedCodePackage, getGlobalWebXmlSource, getHostConfigBase, getHostWebXmlSource, getUseGeneratedCode, getWebXmlSource, init, lifecycleEvent, processAnnotations, processAnnotationsFile, processAnnotationsInParallel, processAnnotationsJar, processAnnotationsStream, processAnnotationsStringArray, processAnnotationsUrl, processAnnotationsWebResource, processAnnotationWebFilter, processAnnotationWebInitParams, processAnnotationWebServlet, processClass, processClasses, processContextConfig, processJarsForWebFragments, processResourceJARs, processServletContainerInitializers, setCustomAuthenticators, setDefaultWebXml, validateSecurityRoles, webConfig
    • Constructor Detail

      • EmbeddedContextConfig

        public EmbeddedContextConfig()
        Initialize the context config so to disable processing of the default global web.xml. As an embedded container we lack the stock config file compliment.
    • Method Detail

      • beforeStart

        protected void beforeStart()
        Override to apply the equivalent of the stock "$CATALINA_BASE/conf/web.xml" to contexts programmatically.
        Overrides:
        beforeStart in class org.apache.catalina.startup.ContextConfig
      • fixDocBase

        protected void fixDocBase()
                           throws IOException
        Override to assign an internal field that will trigger the removal of the unpacked WAR when the context is closed.
        Overrides:
        fixDocBase in class org.apache.catalina.startup.ContextConfig
        Throws:
        IOException