com.liferay.support.tomcat.startup
Class PortalHostConfig

java.lang.Object
  extended by org.apache.catalina.startup.HostConfig
      extended by com.liferay.support.tomcat.startup.PortalHostConfig
All Implemented Interfaces:
org.apache.catalina.LifecycleListener

public class PortalHostConfig
extends org.apache.catalina.startup.HostConfig

Tomcat will always process XML descriptors first, then packaged WARs, and then exploded WARs. However, Tomcat does not have a predictable load order for the XML descriptors or the WARs. It relies on Java's java.io.File.list() implementation which is not predictable. This class overrides several of the deploy methods to ensure that the files are always processed alphabetically (case sensitive).

To use this class, modify Tomcat's conf/server.xml. Find the Host element and add the attribute hostConfigClass.

See http://issues.liferay.com/browse/LEP-2346.

See org.apache.catalina.startup.HostConfig.

Author:
Brian Wing Shun Chan

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
appBase, configBase, configClass, contextClass, copyXML, deployed, deployXML, digester, host, invalidWars, oname, serviced, sm, unpackWARs
 
Constructor Summary
PortalHostConfig()
           
 
Method Summary
protected  void deployDescriptors(java.io.File configBase, java.lang.String[] files)
           
protected  void deployDirectories(java.io.File appBase, java.lang.String[] files)
           
protected  void deployWARs(java.io.File appBase, java.lang.String[] files)
           
protected  java.lang.String[] sortFiles(java.lang.String[] files)
           
 
Methods inherited from class org.apache.catalina.startup.HostConfig
addGlobalRedeployResources, addServiced, addWatchedResources, appBase, check, check, checkResources, checkUndeploy, configBase, createDigester, deployApps, deployApps, deployDescriptor, deployDirectory, deploymentExists, deployWAR, filterAppPaths, getConfigBaseName, getConfigClass, getContextClass, getDeploymentTime, isCopyXML, isDeployed, isDeployXML, isServiced, isUnpackWARs, lifecycleEvent, manageApp, removeServiced, returnCanonicalPath, setConfigClass, setContextClass, setCopyXML, setDeployXML, setUnpackWARs, start, stop, unmanageApp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalHostConfig

public PortalHostConfig()
Method Detail

deployDescriptors

protected void deployDescriptors(java.io.File configBase,
                                 java.lang.String[] files)
Overrides:
deployDescriptors in class org.apache.catalina.startup.HostConfig

deployDirectories

protected void deployDirectories(java.io.File appBase,
                                 java.lang.String[] files)
Overrides:
deployDirectories in class org.apache.catalina.startup.HostConfig

deployWARs

protected void deployWARs(java.io.File appBase,
                          java.lang.String[] files)
Overrides:
deployWARs in class org.apache.catalina.startup.HostConfig

sortFiles

protected java.lang.String[] sortFiles(java.lang.String[] files)