Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 95687 invoked from network); 31 May 2002 02:55:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 31 May 2002 02:55:38 -0000 Received: (qmail 23992 invoked by uid 97); 31 May 2002 02:55:37 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 23943 invoked by uid 97); 31 May 2002 02:55:36 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 23932 invoked by uid 97); 31 May 2002 02:55:35 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 31 May 2002 02:55:21 -0000 Message-ID: <20020531025521.70204.qmail@icarus.apache.org> From: remm@apache.org To: jakarta-tomcat-4.0-cvs@apache.org Subject: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming ContextBindings.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N remm 2002/05/30 19:55:21 Modified: catalina/src/share/org/apache/naming ContextBindings.java Log: - Make the JNDI context available from webapp created CL (as long as one of the parents in the hierarchy is the webapp CL). - Patch submitted by David Haraburda Revision Changes Path 1.7 +31 -18 jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/ContextBindings.java Index: ContextBindings.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/ContextBindings.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ContextBindings.java 16 Apr 2002 00:42:10 -0000 1.6 +++ ContextBindings.java 31 May 2002 02:55:21 -0000 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/ContextBindings.java,v 1.6 2002/04/16 00:42:10 remm Exp $ - * $Revision: 1.6 $ - * $Date: 2002/04/16 00:42:10 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/ContextBindings.java,v 1.7 2002/05/31 02:55:21 remm Exp $ + * $Revision: 1.7 $ + * $Date: 2002/05/31 02:55:21 $ * * ==================================================================== * @@ -76,7 +76,7 @@ * * * @author Remy Maucherat - * @version $Revision: 1.6 $ $Date: 2002/04/16 00:42:10 $ + * @version $Revision: 1.7 $ $Date: 2002/05/31 02:55:21 $ */ public class ContextBindings { @@ -361,12 +361,16 @@ */ public static Context getClassLoader() throws NamingException { - Context context = (Context) clBindings.get - (Thread.currentThread().getContextClassLoader()); - if (context == null) - throw new NamingException - (sm.getString("contextBindings.noContextBoundToCL")); - return context; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + Context context = null; + do { + context = (Context) clBindings.get(cl); + if (context != null) { + return context; + } + } while ((cl = cl.getParent()) != null); + throw new NamingException + (sm.getString("contextBindings.noContextBoundToCL")); } @@ -375,12 +379,16 @@ */ static Object getClassLoaderName() throws NamingException { - Object name = - clNameBindings.get(Thread.currentThread().getContextClassLoader()); - if (name == null) - throw new NamingException - (sm.getString("contextBindings.noContextBoundToCL")); - return name; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + Object name = null; + do { + name = clNameBindings.get(cl); + if (name != null) { + return name; + } + } while ((cl = cl.getParent()) != null); + throw new NamingException + (sm.getString("contextBindings.noContextBoundToCL")); } @@ -388,8 +396,13 @@ * Tests if current class loader is bound to a context. */ public static boolean isClassLoaderBound() { - return (clBindings.containsKey - (Thread.currentThread().getContextClassLoader())); + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + do { + if (clBindings.containsKey(cl)) { + return true; + } + } while ((cl = cl.getParent()) != null); + return false; } -- To unsubscribe, e-mail: For additional commands, e-mail: