Author: remy.maucherat(a)jboss.com
Date: 2010-04-16 09:49:07 -0400 (Fri, 16 Apr 2010)
New Revision: 1441
Modified:
trunk/java/org/apache/catalina/Context.java
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/core/StandardPart.java
trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- More standalone code removal.
Modified: trunk/java/org/apache/catalina/Context.java
===================================================================
--- trunk/java/org/apache/catalina/Context.java 2010-04-16 12:34:31 UTC (rev 1440)
+++ trunk/java/org/apache/catalina/Context.java 2010-04-16 13:49:07 UTC (rev 1441)
@@ -206,20 +206,6 @@
/**
- * Return the path to a file to save this Context information.
- */
- public String getConfigFile();
-
-
- /**
- * Set the path to a file to save this Context information.
- *
- * @param configFile The path to a file to save this Context information.
- */
- public void setConfigFile(String configFile);
-
-
- /**
* Return the "correctly configured" flag for this Context.
*/
public boolean getConfigured();
@@ -460,20 +446,6 @@
/**
- * Return the reloadable flag for this web application.
- */
- public boolean getReloadable();
-
-
- /**
- * Set the reloadable flag for this web application.
- *
- * @param reloadable The new reloadable flag
- */
- public void setReloadable(boolean reloadable);
-
-
- /**
* Return the override flag for this web application.
*/
public boolean getOverride();
@@ -733,15 +705,6 @@
/**
- * Add a resource which will be watched for reloading by the host auto
- * deployer. Note: this will not be used in embedded mode.
- *
- * @param name Path to the resource, relative to docBase
- */
- public void addWatchedResource(String name);
-
-
- /**
* Add a new welcome file to the set recognized by this Context.
*
* @param name New welcome file name
@@ -957,13 +920,6 @@
/**
- * Return the set of watched resources for this Context. If none are
- * defined, a zero length array will be returned.
- */
- public String[] findWatchedResources();
-
-
- /**
* Return <code>true</code> if the specified welcome file is defined
* for this Context; otherwise return <code>false</code>.
*
@@ -1115,15 +1071,6 @@
/**
- * Remove the specified watched resource name from the list associated
- * with this Context.
- *
- * @param name Name of the watched resource to be removed
- */
- public void removeWatchedResource(String name);
-
-
- /**
* Remove the specified welcome file name from the list recognized
* by this Context.
*
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2010-04-16 12:34:31 UTC (rev
1440)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2010-04-16 13:49:07 UTC (rev
1441)
@@ -34,7 +34,6 @@
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
-import java.util.Stack;
import java.util.TreeMap;
import javax.management.AttributeNotFoundException;
@@ -188,18 +187,6 @@
/**
- * The antiJARLocking flag for this Context.
- */
- protected boolean antiJARLocking = false;
-
-
- /**
- * The antiResourceLocking flag for this Context.
- */
- protected boolean antiResourceLocking = false;
-
-
- /**
* The set of application listener class names configured for this
* application, in the order they were encountered in the web.xml file.
*/
@@ -287,12 +274,6 @@
/**
- * The path to a file to save this Context information.
- */
- protected String configFile = null;
-
-
- /**
* The "correctly configured" flag for this Context.
*/
protected boolean configured = false;
@@ -311,12 +292,6 @@
/**
- * Compiler classpath to use.
- */
- protected String compilerClasspath = null;
-
-
- /**
* The class name of the context configurator.
*/
protected String configClass = null;
@@ -349,30 +324,11 @@
/**
- * The "follow standard delegation model" flag that will be used to
- * configure our ClassLoader.
- */
- protected boolean delegate = false;
-
-
- /**
* The display name of this web application.
*/
protected String displayName = null;
- /**
- * Override the default context xml location.
- */
- protected String defaultContextXml;
-
-
- /**
- * Override the default web xml location.
- */
- protected String defaultWebXml;
-
-
/**
* The distributable flag for this web application.
*/
@@ -523,30 +479,12 @@
/**
- * The reloadable flag for this web application.
+ * The override flag for this web application.
*/
- protected boolean reloadable = false;
-
-
- /**
- * Unpack WAR property.
- */
- protected boolean unpackWAR = true;
-
-
- /**
- * The DefaultContext override flag for this web application.
- */
protected boolean override = false;
/**
- * The original document root for this web application.
- */
- protected String originalDocBase = null;
-
-
- /**
* The privileged flag for this web application.
*/
protected boolean privileged = false;
@@ -624,12 +562,6 @@
/**
- * The watched resources for this application.
- */
- protected String watchedResources[] = new String[0];
-
-
- /**
* The welcome files for this application.
*/
protected String welcomeFiles[] = new String[0];
@@ -670,12 +602,6 @@
/**
- * Name of the associated naming context.
- */
- protected String namingContextName = null;
-
-
- /**
* Caching allowed flag.
*/
protected boolean cachingAllowed = true;
@@ -711,8 +637,6 @@
protected int cacheTTL = 5000;
- protected boolean lazy=true;
-
/**
* Non proxied resources.
*/
@@ -851,28 +775,6 @@
/**
- * Return the "follow standard delegation model" flag used to configure
- * our ClassLoader.
- */
- public boolean getDelegate() {
- return (this.delegate);
- }
-
-
- /**
- * Set the "follow standard delegation model" flag used to configure
- * our ClassLoader.
- *
- * @param delegate The new flag
- */
- public void setDelegate(boolean delegate) {
- boolean oldDelegate = this.delegate;
- this.delegate = delegate;
- support.firePropertyChange("delegate", oldDelegate, this.delegate);
- }
-
-
- /**
* Returns true if the resources associated with this context are
* filesystem based.
*/
@@ -967,46 +869,6 @@
/**
- * Return the antiJARLocking flag for this Context.
- */
- public boolean getAntiJARLocking() {
- return (this.antiJARLocking);
- }
-
-
- /**
- * Return the antiResourceLocking flag for this Context.
- */
- public boolean getAntiResourceLocking() {
- return (this.antiResourceLocking);
- }
-
-
- /**
- * Set the antiJARLocking feature for this Context.
- *
- * @param antiJARLocking The new flag value
- */
- public void setAntiJARLocking(boolean antiJARLocking) {
- boolean oldAntiJARLocking = this.antiJARLocking;
- this.antiJARLocking = antiJARLocking;
- support.firePropertyChange("antiJARLocking", oldAntiJARLocking,
this.antiJARLocking);
- }
-
-
- /**
- * Set the antiResourceLocking feature for this Context.
- *
- * @param antiResourceLocking The new flag value
- */
- public void setAntiResourceLocking(boolean antiResourceLocking) {
- boolean oldAntiResourceLocking = this.antiResourceLocking;
- this.antiResourceLocking = antiResourceLocking;
- support.firePropertyChange("antiResourceLocking",
oldAntiResourceLocking, this.antiResourceLocking);
- }
-
-
- /**
* Return the application authenticator for this Context.
*/
public Authenticator getAuthenticator() {
@@ -1100,24 +962,6 @@
}
/**
- * Return the path to a file to save this Context information.
- */
- public String getConfigFile() {
- return (this.configFile);
- }
-
-
- /**
- * Set the path to a file to save this Context information.
- *
- * @param configFile The path to a file to save this Context information.
- */
- public void setConfigFile(String configFile) {
- this.configFile = configFile;
- }
-
-
- /**
* Return the class name of the context configurator.
*/
public String getConfigClass() {
@@ -1203,36 +1047,6 @@
support.firePropertyChange("crossContext", oldCrossContext,
this.crossContext);
}
- public String getDefaultContextXml() {
- return defaultContextXml;
- }
-
- /**
- * Set the location of the default context xml that will be used.
- * If not absolute, it'll be made relative to the engine's base dir
- * ( which defaults to catalina.base system property ).
- *
- * @param defaultContextXml The default web xml
- */
- public void setDefaultContextXml(String defaultContextXml) {
- this.defaultContextXml = defaultContextXml;
- }
-
- public String getDefaultWebXml() {
- return defaultWebXml;
- }
-
- /**
- * Set the location of the default web xml that will be used.
- * If not absolute, it'll be made relative to the engine's base dir
- * ( which defaults to catalina.base system property ).
- *
- * @param defaultWebXml The default web xml
- */
- public void setDefaultWebXml(String defaultWebXml) {
- this.defaultWebXml = defaultWebXml;
- }
-
/**
* Gets the time (in milliseconds) it took to start this context.
*
@@ -1282,22 +1096,6 @@
/**
- * Return the compiler classpath.
- */
- public String getCompilerClasspath(){
- return compilerClasspath;
- }
-
-
- /**
- * Set the compiler classpath.
- */
- public void setCompilerClasspath(String compilerClasspath) {
- this.compilerClasspath = compilerClasspath;
- }
-
-
- /**
* Set the display name of this web application.
*
* @param displayName The new display name
@@ -1350,16 +1148,6 @@
this.docBase = docBase;
}
- // experimental
- public boolean isLazy() {
- return lazy;
- }
-
- public void setLazy(boolean lazy) {
- this.lazy = lazy;
- }
-
-
/**
* Return descriptive information about this Container implementation and
* the corresponding version number, in the format
@@ -1625,14 +1413,6 @@
/**
- * Return the reloadable flag for this web application.
- */
- public boolean getReloadable() {
- return (this.reloadable);
-
- }
-
- /**
* Return the DefaultContext override flag for this web application.
*/
public boolean getOverride() {
@@ -1641,26 +1421,6 @@
/**
- * Return the original document root for this Context. This can be an absolute
- * pathname, a relative pathname, or a URL.
- * Is only set as deployment has change docRoot!
- */
- public String getOriginalDocBase() {
- return (this.originalDocBase);
- }
-
- /**
- * Set the original document root for this Context. This can be an absolute
- * pathname, a relative pathname, or a URL.
- *
- * @param docBase The orginal document root
- */
- public void setOriginalDocBase(String docBase) {
- this.originalDocBase = docBase;
- }
-
-
- /**
* Return the parent class loader (if any) for this web application.
* This call is meaningful only <strong>after</strong> a Loader has
* been configured.
@@ -1698,20 +1458,8 @@
/**
- * Set the reloadable flag for this web application.
+ * Set the override flag for this web application.
*
- * @param reloadable The new reloadable flag
- */
- public void setReloadable(boolean reloadable) {
- boolean oldReloadable = this.reloadable;
- this.reloadable = reloadable;
- support.firePropertyChange("reloadable", oldReloadable,
this.reloadable);
- }
-
-
- /**
- * Set the DefaultContext override flag for this web application.
- *
* @param override The new override flag
*/
public void setOverride(boolean override) {
@@ -1860,21 +1608,6 @@
/**
- * Unpack WAR flag accessor.
- */
- public boolean getUnpackWAR() {
- return (unpackWAR);
- }
-
-
- /**
- * Unpack WAR flag mutator.
- */
- public void setUnpackWAR(boolean unpackWAR) {
- this.unpackWAR = unpackWAR;
- }
-
- /**
* Return the Java class name of the Wrapper implementation used
* for servlets registered in this Context.
*/
@@ -2573,21 +2306,6 @@
/**
- * Add a new watched resource to the set recognized by this Context.
- *
- * @param name New watched resource file name
- */
- public void addWatchedResource(String name) {
- String results[] = new String[watchedResources.length + 1];
- for (int i = 0; i < watchedResources.length; i++)
- results[i] = watchedResources[i];
- results[watchedResources.length] = name;
- watchedResources = results;
- fireContainerEvent("addWatchedResource", name);
- }
-
-
- /**
* Add a new welcome file to the set recognized by this Context.
*
* @param name New welcome file name
@@ -3008,15 +2726,6 @@
/**
- * Return the set of watched resources for this Context. If none are
- * defined, a zero length array will be returned.
- */
- public String[] findWatchedResources() {
- return watchedResources;
- }
-
-
- /**
* Return the set of welcome files defined for this Context. If none are
* defined, a zero-length array is returned.
*/
@@ -3412,39 +3121,6 @@
/**
- * Remove the specified watched resource name from the list associated
- * with this Context.
- *
- * @param name Name of the watched resource to be removed
- */
- public void removeWatchedResource(String name) {
-
- // Make sure this watched resource is currently present
- int n = -1;
- for (int i = 0; i < watchedResources.length; i++) {
- if (watchedResources[i].equals(name)) {
- n = i;
- break;
- }
- }
- if (n < 0)
- return;
-
- // Remove the specified watched resource
- int j = 0;
- String results[] = new String[watchedResources.length - 1];
- for (int i = 0; i < watchedResources.length; i++) {
- if (i != n)
- results[j++] = watchedResources[i];
- }
- watchedResources = results;
-
- fireContainerEvent("removeWatchedResource", name);
-
- }
-
-
- /**
* Remove the specified welcome file name from the list recognized
* by this Context.
*
@@ -4013,7 +3689,6 @@
* @exception LifecycleException if a startup error occurs
*/
public synchronized void start() throws LifecycleException {
- //if (lazy ) return;
if (started) {
return;
}
@@ -4734,32 +4409,6 @@
/**
- * Get naming context full name.
- */
- protected String getNamingContextName() {
- if (namingContextName == null) {
- Container parent = getParent();
- if (parent == null) {
- namingContextName = getName();
- } else {
- Stack stk = new Stack();
- StringBuilder buff = new StringBuilder();
- while (parent != null) {
- stk.push(parent.getName());
- parent = parent.getParent();
- }
- while (!stk.empty()) {
- buff.append("/" + stk.pop());
- }
- buff.append(getName());
- namingContextName = buff.toString();
- }
- }
- return namingContextName;
- }
-
-
- /**
* Return the request processing paused flag for this Context.
*/
public boolean getPaused() {
Modified: trunk/java/org/apache/catalina/core/StandardPart.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardPart.java 2010-04-16 12:34:31 UTC (rev
1440)
+++ trunk/java/org/apache/catalina/core/StandardPart.java 2010-04-16 13:49:07 UTC (rev
1441)
@@ -25,7 +25,6 @@
import java.util.HashSet;
import java.util.Iterator;
-import javax.servlet.MultipartConfigElement;
import javax.servlet.http.Part;
import org.apache.catalina.deploy.Multipart;
Modified: trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
===================================================================
--- trunk/java/org/apache/catalina/core/mbeans-descriptors.xml 2010-04-16 12:34:31 UTC
(rev 1440)
+++ trunk/java/org/apache/catalina/core/mbeans-descriptors.xml 2010-04-16 13:49:07 UTC
(rev 1441)
@@ -39,14 +39,6 @@
description="Object that creates and destroys servlets, filters, and
listeners. Include dependency injection and postConstruct/preDestory handling"
type="org.apache.catalina.instanceManagement.InstanceManager"
/>
- <attribute name="antiJARLocking"
- description="Take care to not lock jar files"
- type="boolean" />
-
- <attribute name="antiResourceLocking"
- description="Take care to not lock resources"
- type="boolean" />
-
<attribute name="cacheMaxSize"
description="Maximum cache size in KB"
type="int"/>
@@ -73,35 +65,15 @@
description="Object names of all children"
type="[Ljavax.management.ObjectName;"/>
- <attribute name="configFile"
- description="Location of the context.xml resource or file"
- type="java.lang.String"/>
-
<attribute name="cookies"
description="Should we attempt to use cookies for session id
communication?"
type="boolean"/>
- <attribute name="compilerClasspath"
- description="The compiler classpath to use"
- type="java.lang.String"/>
-
<attribute name="crossContext"
description="Should we allow the ServletContext.getContext() method
to access the context of other web applications in this server?"
type="boolean"/>
- <attribute name="defaultContextXml"
- description="Location of the default context.xml resource or
file"
- type="java.lang.String"/>
-
- <attribute name="defaultWebXml"
- description="Location of the default web.xml resource or file"
- type="java.lang.String"/>
-
- <attribute name="delegate"
- description=""
- type="boolean"/>
-
<attribute name="deploymentDescriptor"
description="String deployment descriptor "
type="java.lang.String"/>
@@ -171,15 +143,6 @@
description="Associated realm."
type="org.apache.catalina.Realm" />
- <attribute name="reloadable"
- description="The reloadable flag for this web application"
- type="boolean"/>
-
- <attribute name="saveConfig"
- description="Should the configuration be written as needed on
startup"
- is="true"
- type="boolean"/>
-
<attribute name="server"
description="The J2EE Server this module is deployed on"
type="java.lang.String"/>
@@ -233,11 +196,6 @@
description="Time spend scanning jars for TLDs for this
context"
type="long"/>
- <attribute name="useNaming"
- description="Create a JNDI naming context for this
application?"
- is="true"
- type="boolean"/>
-
<attribute name="valveObjectNames"
description="ObjectNames for the valves associated with this
container"
type="[Ljavax.management.ObjectName;"
@@ -432,11 +390,6 @@
description="Unique name of this Host"
type="java.lang.String"/>
- <attribute name="unpackWARs"
- description="Unpack WARs property"
- is="true"
- type="boolean"/>
-
<attribute name="children"
description="Object names of all children"
type="[Ljavax.management.ObjectName;"/>
@@ -518,14 +471,6 @@
description="The managed resource this MBean is associated
with"
type="java.lang.Object"/>
- <attribute name="port"
- description="TCP port for shutdown messages"
- type="int"/>
-
- <attribute name="shutdown"
- description="Shutdown password"
- type="java.lang.String"/>
-
<attribute name="serviceNames"
description="Object names of all services we know about"
type="[Ljavax.management.ObjectName;"/>
@@ -535,18 +480,6 @@
type="java.lang.String"
writeable="false"/>
- <operation name="await"
- description="Wait for the shutdown message"
- impact="ACTION"
- returnType="void" />
-
- <operation name="storeConfig"
- description="Save current state to server.xml file"
- impact="ACTION"
- returnType="void">
-
- </operation>
-
</mbean>
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2010-04-16 12:34:31 UTC (rev
1440)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2010-04-16 13:49:07 UTC (rev
1441)
@@ -57,13 +57,8 @@
import java.util.Properties;
import java.util.Set;
-import javax.servlet.DispatcherType;
import javax.servlet.HttpMethodConstraintElement;
import javax.servlet.ServletSecurityElement;
-import javax.servlet.annotation.WebFilter;
-import javax.servlet.annotation.WebInitParam;
-import javax.servlet.annotation.WebListener;
-import javax.servlet.annotation.WebServlet;
import javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic;
import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
@@ -128,30 +123,12 @@
/**
- * The default web application's context file location.
- */
- protected String defaultContextXml = null;
-
-
- /**
- * The default web application's deployment descriptor location.
- */
- protected String defaultWebXml = null;
-
-
- /**
* Track any fatal errors during startup configuration processing.
*/
protected boolean ok = false;
/**
- * Original docBase.
- */
- protected String originalDocBase = null;
-
-
- /**
* The string resources for this package.
*/
protected static final StringManager sm =
@@ -172,56 +149,6 @@
/**
- * Return the location of the default deployment descriptor
- */
- public String getDefaultWebXml() {
- if( defaultWebXml == null ) {
- defaultWebXml=Constants.DefaultWebXml;
- }
-
- return (this.defaultWebXml);
-
- }
-
-
- /**
- * Set the location of the default deployment descriptor
- *
- * @param path Absolute/relative path to the default web.xml
- */
- public void setDefaultWebXml(String path) {
-
- this.defaultWebXml = path;
-
- }
-
-
- /**
- * Return the location of the default context file
- */
- public String getDefaultContextXml() {
- if( defaultContextXml == null ) {
- defaultContextXml=Constants.DefaultContextXml;
- }
-
- return (this.defaultContextXml);
-
- }
-
-
- /**
- * Set the location of the default context file
- *
- * @param path Absolute/relative path to the default context.xml
- */
- public void setDefaultContextXml(String path) {
-
- this.defaultContextXml = path;
-
- }
-
-
- /**
* Sets custom mappings of login methods to authenticators.
*
* @param customAuthenticators Custom mappings of login methods to
@@ -256,20 +183,10 @@
} else if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
beforeStart();
} else if (event.getType().equals(Lifecycle.AFTER_START_EVENT)) {
- // Restore docBase for management tools
- if (originalDocBase != null) {
- String docBase = context.getDocBase();
- context.setDocBase(originalDocBase);
- originalDocBase = docBase;
- }
+
} else if (event.getType().equals(Context.COMPLETE_CONFIG_EVENT)) {
completeConfig();
} else if (event.getType().equals(Lifecycle.STOP_EVENT)) {
- if (originalDocBase != null) {
- String docBase = context.getDocBase();
- context.setDocBase(originalDocBase);
- originalDocBase = docBase;
- }
stop();
} else if (event.getType().equals(Lifecycle.INIT_EVENT)) {
init();
@@ -284,72 +201,6 @@
/**
- * Process the application classes annotations, if it exists.
- */
- protected void processConfigAnnotations(Class<?> clazz) {
-
- if (clazz.isAnnotationPresent(WebFilter.class)) {
- WebFilter annotation = clazz.getAnnotation(WebFilter.class);
- // Add servlet filter
- String filterName = annotation.filterName();
- FilterDef filterDef = new FilterDef();
- filterDef.setFilterName(annotation.filterName());
- filterDef.setFilterClass(clazz.getName());
- WebInitParam[] params = annotation.initParams();
- for (int i = 0; i < params.length; i++) {
- filterDef.addInitParameter(params[i].name(), params[i].value());
- }
- context.addFilterDef(filterDef);
- FilterMap filterMap = new FilterMap();
- filterMap.setFilterName(filterName);
- for (String urlPattern : annotation.urlPatterns()) {
- filterMap.addURLPattern(urlPattern);
- }
- for (String urlPattern : annotation.value()) {
- filterMap.addURLPattern(urlPattern);
- }
- String[] servletNames = annotation.servletNames();
- if (servletNames != null) {
- for (int i = 0; i < servletNames.length; i++) {
- filterMap.addServletName(servletNames[i]);
- }
- }
- DispatcherType[] dispatcherTypes = annotation.dispatcherTypes();
- if (dispatcherTypes != null) {
- for (int i = 0; i < dispatcherTypes.length; i++) {
- filterMap.setDispatcher(dispatcherTypes[i].toString());
- }
- }
- context.addFilterMap(filterMap);
- }
- if (clazz.isAnnotationPresent(WebServlet.class)) {
- WebServlet annotation = clazz.getAnnotation(WebServlet.class);
- // Add servlet
- Wrapper wrapper = context.createWrapper();
- wrapper.setName(annotation.name());
- wrapper.setServletClass(clazz.getName());
- wrapper.setLoadOnStartup(annotation.loadOnStartup());
- WebInitParam[] params = annotation.initParams();
- for (int i = 0; i < params.length; i++) {
- wrapper.addInitParameter(params[i].name(), params[i].value());
- }
- context.addChild(wrapper);
- for (String urlPattern : annotation.urlPatterns()) {
- context.addServletMapping(urlPattern, annotation.name());
- }
- for (String urlPattern : annotation.value()) {
- context.addServletMapping(urlPattern, annotation.name());
- }
- }
- if (clazz.isAnnotationPresent(WebListener.class)) {
- // Add listener
- context.addApplicationListener(clazz.getName());
- }
-
- }
-
-
- /**
* Process the application configuration file, if it exists.
*/
protected void applicationWebConfig() {
@@ -522,68 +373,6 @@
}
- protected void antiLocking() {
-
- if ((context instanceof StandardContext)
- && ((StandardContext) context).getAntiResourceLocking()) {
-
- Host host = (Host) context.getParent();
- String appBase = host.getAppBase();
- String docBase = context.getDocBase();
- if (docBase == null)
- return;
- if (originalDocBase == null) {
- originalDocBase = docBase;
- } else {
- docBase = originalDocBase;
- }
- File docBaseFile = new File(docBase);
- if (!docBaseFile.isAbsolute()) {
- File file = new File(appBase);
- if (!file.isAbsolute()) {
- file = new File(System.getProperty("catalina.base"),
appBase);
- }
- docBaseFile = new File(file, docBase);
- }
-
- String path = context.getPath();
- if (path == null) {
- return;
- }
- if (path.equals("")) {
- docBase = "ROOT";
- } else {
- if (path.startsWith("/")) {
- docBase = path.substring(1);
- } else {
- docBase = path;
- }
- }
-
- File file = null;
- if (docBase.toLowerCase().endsWith(".war")) {
- file = new File(System.getProperty("java.io.tmpdir"),
- deploymentCount++ + "-" + docBase + ".war");
- } else {
- file = new File(System.getProperty("java.io.tmpdir"),
- deploymentCount++ + "-" + docBase);
- }
-
- if (log.isDebugEnabled())
- log.debug("Anti locking context[" + context.getPath()
- + "] setting docBase to " + file);
-
- // Cleanup just in case an old deployment is lying around
- ExpandWar.delete(file);
- if (ExpandWar.copy(docBaseFile, file)) {
- context.setDocBase(file.getAbsolutePath());
- }
-
- }
-
- }
-
-
/**
* Process a "init" event for this Context.
*/
@@ -599,7 +388,6 @@
* Process a "before start" event for this Context.
*/
protected void beforeStart() {
- antiLocking();
}
@@ -773,19 +561,6 @@
context.removeWrapperListener(wrapperListeners[i]);
}
- // Remove (partially) folders and files created by antiLocking
- Host host = (Host) context.getParent();
- String appBase = host.getAppBase();
- String docBase = context.getDocBase();
- if ((docBase != null) && (originalDocBase != null)) {
- File docBaseFile = new File(docBase);
- if (!docBaseFile.isAbsolute()) {
- docBaseFile = new File(appBase, docBase);
- }
- // No need to log failure - it is expected in this case
- ExpandWar.delete(docBaseFile, false);
- }
-
ok = true;
}
@@ -985,20 +760,6 @@
}
- /**
- * Get config base.
- */
- protected File getConfigBase() {
- File configBase =
- new File(System.getProperty("catalina.base"), "conf");
- if (!configBase.exists()) {
- return null;
- } else {
- return configBase;
- }
- }
-
-
protected String getHostConfigPath(String resourceName) {
StringBuilder result = new StringBuilder();
Container container = context;