commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r427477 - /jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java
Date Tue, 01 Aug 2006 07:37:00 GMT
Author: skitching
Date: Tue Aug  1 00:37:00 2006
New Revision: 427477

URL: http://svn.apache.org/viewvc?rev=427477&view=rev
Log:
Add javadoc only.

Modified:
    jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java

Modified: jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java?rev=427477&r1=427476&r2=427477&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java
Tue Aug  1 00:37:00 2006
@@ -135,6 +135,9 @@
      * <pre>
      * useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
      * </pre>
+     * <p>
+     * Of course, this assumes that the classes of interest are already
+     * in the classpath of the system classloader.
      */
     public void useSystemLoader(String prefix) {
         useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
@@ -192,6 +195,12 @@
      * be found. Typically this is the name of a jar file, or a directory
      * containing class files.
      * <p>
+     * If there is no system property, but the classloader that loaded
+     * this class is a URLClassLoader then the set of URLs that the
+     * classloader uses for its classpath is scanned; any jar in the
+     * URL set whose name starts with the specified string is added to
+     * the classpath managed by this instance. 
+     * <p>
      * Using logical library names allows the calling code to specify its
      * desired classpath without knowing the exact location of the necessary
      * classes. 
@@ -223,6 +232,20 @@
             + " as a System property.");
     }
 
+    /**
+     * If the classloader that loaded this class has this logical lib in its
+     * path, then return the matching URL otherwise return null.
+     * <p>
+     * This only works when the classloader loading this class is an instance
+     * of URLClassLoader and thus has a getURLs method that returns the classpath
+     * it uses when loading classes. However in practice, the vast majority of the
+     * time this type is the classloader used.
+     * <p>
+     * The classpath of the classloader for this instance is scanned, and any
+     * jarfile in the path whose name starts with the logicalLib string is
+     * considered a match. For example, passing "foo" will match a url
+     * of <code>file:///some/where/foo-2.7.jar</code>.
+     */
     private URL libFromClasspath(String logicalLib) {
         ClassLoader cl = this.getClass().getClassLoader();
         if (cl instanceof URLClassLoader == false) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message