From: markt Date: Fri, 5 Nov 2010 21:08:09 +0000 (+0000) Subject: Parallel deployment X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1a2e3940d0dc2c539cc14523fe72b2c68b66aaf6;p=tomcat7.0 Parallel deployment Additional Context.get[Name|Path]() clean up git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1031795 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/naming/resources/DirContextURLConnection.java b/java/org/apache/naming/resources/DirContextURLConnection.java index e676221ab..76278f8ad 100644 --- a/java/org/apache/naming/resources/DirContextURLConnection.java +++ b/java/org/apache/naming/resources/DirContextURLConnection.java @@ -140,17 +140,17 @@ public class DirContextURLConnection ProxyDirContext proxyDirContext = (ProxyDirContext) context; String hostName = proxyDirContext.getHostName(); - String contextName = proxyDirContext.getContextName(); + String contextPath = proxyDirContext.getContextPath(); if (hostName != null) { if (!path.startsWith("/" + hostName + "/")) return; path = path.substring(hostName.length()+ 1); } - if (contextName != null) { - if (!path.startsWith(contextName + "/")) { + if (contextPath != null) { + if (!path.startsWith(contextPath + "/")) { return; } - path = path.substring(contextName.length()); + path = path.substring(contextPath.length()); } } object = context.lookup(path); @@ -432,7 +432,7 @@ public class DirContextURLConnection // Strip off the hostname and the contextpath int start; if(context instanceof ProxyDirContext && - "".equals(((ProxyDirContext)context).getContextName())){ + "".equals(((ProxyDirContext)context).getContextPath())){ start = file.indexOf('/',1); } else diff --git a/java/org/apache/naming/resources/ProxyDirContext.java b/java/org/apache/naming/resources/ProxyDirContext.java index b8a3fdfcc..b86dabfd3 100644 --- a/java/org/apache/naming/resources/ProxyDirContext.java +++ b/java/org/apache/naming/resources/ProxyDirContext.java @@ -97,6 +97,12 @@ public class ProxyDirContext implements DirContext { } hostName = env.get(HOST); contextName = env.get(CONTEXT); + int i = contextName.indexOf('#'); + if (i == -1) { + contextPath = contextName; + } else { + contextPath = contextName.substring(0, i); + } } @@ -147,6 +153,12 @@ public class ProxyDirContext implements DirContext { /** + * Context path. + */ + protected String contextPath; + + + /** * Cache class. */ protected String cacheClassName = @@ -223,6 +235,14 @@ public class ProxyDirContext implements DirContext { } + /** + * Return the context path. + */ + public String getContextPath() { + return this.contextPath; + } + + // -------------------------------------------------------- Context Methods