Class EmbeddedHostConfig

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

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

    This configuration makes the protected Tomcat WAR deployment implementation (as is used by the typical standalone server) available for embedded use. We do this to retain standard deployment features that are notably absent from the current Tomcat deployment logic, for instance:

    • Deployment of an archive named "ROOT.war" to the default context "/".
    • Proper processing of "META-INF/context.xml" if present in the WAR.

    You'll very likely want to set the ContextConfig class for the associated host to an EmbeddedContextConfig via host.setConfigClass(EmbeddedContextConfig.class.getCanonicalName()). (Note that HostConfig#getConfigClass() is not currently used.) This will result in the application of context configuration normally sourced from "$CATALINA_BASE/conf/web.xml". This is typically done by Tomcat via a Tomcat.DefaultWebXmlListener added to the context, but HostConfig lacks a suitable hook to add such a listener prior to the start life cycle.

    Author:
    Ian Brandt
    • Nested Class Summary

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

        org.apache.catalina.startup.HostConfig.DeployedApplication
    • Field Summary

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

        contextClass, copyXML, deployed, deployXML, digester, FILE_MODIFICATION_RESOLUTION_MS, host, invalidWars, oname, sm, unpackWARs
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deployWAR​(String warFileName)
      Deploy a WAR with the given file name to be found in the configured app base.
      void undeployWAR​(String warFileName)
      Undeploy a WAR with the given file name.
      • Methods inherited from class org.apache.catalina.startup.HostConfig

        addGlobalRedeployResources, addWatchedResources, beforeStart, check, check, checkResources, checkUndeploy, createDigester, deployApps, deployApps, deployDescriptor, deployDescriptors, deployDirectories, deployDirectory, deploymentExists, deployWAR, deployWARs, filterAppPaths, getConfigBaseName, getContextClass, getDeploymentTime, isCopyXML, isDeployed, isDeployXML, isUnpackWARs, lifecycleEvent, manageApp, migrateLegacyApp, migrateLegacyApps, removeServiced, returnCanonicalPath, setContextClass, setCopyXML, setDeployXML, setUnpackWARs, start, stop, tryAddServiced, unmanageApp
    • Constructor Detail

      • EmbeddedHostConfig

        public EmbeddedHostConfig()
    • Method Detail

      • deployWAR

        public void deployWAR​(String warFileName)
        Deploy a WAR with the given file name to be found in the configured app base.
        Parameters:
        warFileName - the WAR file name, e.g. "ROOT.war".
      • undeployWAR

        public void undeployWAR​(String warFileName)
        Undeploy a WAR with the given file name.
        Parameters:
        warFileName - the WAR file name, e.g. "ROOT.war".