public class MClassLoader extends java.lang.ClassLoader
A caching ClassLoader that allows addition of JAR files and class directories to the classpath at runtime. This loads resources from its class directories and JAR files first, then tries the parent. This is not the standard approach, but needed for configuration in moqui/runtime and components to override other classpath resources. This loads classes from the parent first, then its class directories and JAR files.
Constructor and description |
---|
MClassLoader
(java.lang.ClassLoader parent) |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addClassesDirectory(java.io.File classesDir) |
|
public static void |
addCommonClass(java.lang.String className, java.lang.Class<?> cls) |
|
public void |
addJarFile(java.util.jar.JarFile jf, java.net.URL jarLocation) |
|
public void |
clearNotFoundInfo() |
|
protected java.net.URL |
findResource(java.lang.String resourceName)
|
|
public java.util.Enumeration<java.net.URL> |
findResources(java.lang.String resourceName)
|
|
public static java.lang.Class<?> |
getCommonClass(java.lang.String className) |
|
public java.net.URL |
getResource(java.lang.String name)
|
|
public java.io.InputStream |
getResourceAsStream(java.lang.String name)
|
|
public java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name)
|
|
public java.lang.Class<?> |
loadClass(java.lang.String name) |
|
protected java.lang.Class<?> |
loadClass(java.lang.String className, boolean resolve) |
Methods inherited from class | Name |
---|---|
class java.lang.ClassLoader |
java.lang.ClassLoader#loadClass(java.lang.String), java.lang.ClassLoader#getPlatformClassLoader(), java.lang.ClassLoader#getSystemClassLoader(), java.lang.ClassLoader#getName(), java.lang.ClassLoader#getResourceAsStream(java.lang.String), java.lang.ClassLoader#getResource(java.lang.String), java.lang.ClassLoader#getSystemResourceAsStream(java.lang.String), java.lang.ClassLoader#getSystemResource(java.lang.String), java.lang.ClassLoader#getResources(java.lang.String), java.lang.ClassLoader#resources(java.lang.String), java.lang.ClassLoader#isRegisteredAsParallelCapable(), java.lang.ClassLoader#getSystemResources(java.lang.String), java.lang.ClassLoader#getParent(), java.lang.ClassLoader#getUnnamedModule(), java.lang.ClassLoader#getDefinedPackage(java.lang.String), java.lang.ClassLoader#getDefinedPackages(), java.lang.ClassLoader#setDefaultAssertionStatus(boolean), java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#clearAssertionStatus(), java.lang.ClassLoader#wait(long), java.lang.ClassLoader#wait(long, int), java.lang.ClassLoader#wait(), java.lang.ClassLoader#equals(java.lang.Object), java.lang.ClassLoader#toString(), java.lang.ClassLoader#hashCode(), java.lang.ClassLoader#getClass(), java.lang.ClassLoader#notify(), java.lang.ClassLoader#notifyAll() |