Author: jaz
Date: Mon May 14 10:09:04 2007
New Revision: 537918
URL:
http://svn.apache.org/viewvc?view=rev&rev=537918Log:
updated catalina container to load webapps in reverse order from how they are defined, also it only attempts to load a webapp once. Apps which "override" the stock apps will now have priority.
Modified:
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?view=diff&rev=537918&r1=537917&r2=537918==============================================================================
--- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Mon May 14 10:09:04 2007
@@ -21,7 +21,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -66,6 +65,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
+import javolution.util.FastList;
/*
* --- Access Log Pattern Information - From Tomcat 5 AccessLogValve.java
@@ -586,19 +586,20 @@
}
// load the applications
- Collection componentConfigs = ComponentConfig.getAllComponents();
- if (componentConfigs != null) {
- Iterator components = componentConfigs.iterator();
- while (components.hasNext()) {
- ComponentConfig component = (ComponentConfig) components.next();
- Iterator appInfos = component.getWebappInfos().iterator();
- while (appInfos.hasNext()) {
- ComponentConfig.WebappInfo appInfo = (ComponentConfig.WebappInfo) appInfos.next();
+ List webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
+ List loadedMounts = FastList.newInstance();
+ if (webResourceInfos != null) {
+ for (int i = webResourceInfos.size(); i > 0; i--) {
+ ComponentConfig.WebappInfo appInfo = (ComponentConfig.WebappInfo) webResourceInfos.get(i - 1);
+ String mount = appInfo.getContextRoot();
+ if (!loadedMounts.contains(mount)) {
createContext(appInfo);
+ loadedMounts.add(mount);
+ } else {
+ Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module);
}
}
- }
-
+ }
}
public void stop() throws ContainerException {