Add javadoc only.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@427477 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -135,6 +135,9 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* <pre>
|
* <pre>
|
||||||
* useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
|
* useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
|
||||||
* </pre>
|
* </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) {
|
public void useSystemLoader(String prefix) {
|
||||||
useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
|
useExplicitLoader(prefix, ClassLoader.getSystemClassLoader());
|
||||||
@@ -192,6 +195,12 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* be found. Typically this is the name of a jar file, or a directory
|
* be found. Typically this is the name of a jar file, or a directory
|
||||||
* containing class files.
|
* containing class files.
|
||||||
* <p>
|
* <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
|
* Using logical library names allows the calling code to specify its
|
||||||
* desired classpath without knowing the exact location of the necessary
|
* desired classpath without knowing the exact location of the necessary
|
||||||
* classes.
|
* classes.
|
||||||
@@ -223,6 +232,20 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
+ " as a System property.");
|
+ " 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) {
|
private URL libFromClasspath(String logicalLib) {
|
||||||
ClassLoader cl = this.getClass().getClassLoader();
|
ClassLoader cl = this.getClass().getClassLoader();
|
||||||
if (cl instanceof URLClassLoader == false) {
|
if (cl instanceof URLClassLoader == false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user