Class PluginClassLoaderFactory
- java.lang.Object
-
- org.apache.log4j.chainsaw.plugins.PluginClassLoaderFactory
-
public class PluginClassLoaderFactory extends java.lang.Object
A factory class to create a Classloader that can refenerence jars/classes/resources within a users plugin directory.Currently a work in progress to see if this allows external jars required by some 3rd party vendors for things like the JMSReceiver.
-
-
Field Summary
Fields Modifier and Type Field Description private static PluginClassLoaderFactory
instance
private java.lang.ClassLoader
pluginClassLoader
-
Constructor Summary
Constructors Modifier Constructor Description private
PluginClassLoaderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.ClassLoader
create(java.io.File pluginDirectory)
Creates a Classloader that will be able to access any of the classes found in any .JAR file contained within the specified directory path, PLUS the actual Plugin directory itself, so it acts like the WEB-INF/classes directory, any class file in the directory will be accessiblejava.lang.ClassLoader
getClassLoader()
static PluginClassLoaderFactory
getInstance()
-
-
-
Field Detail
-
pluginClassLoader
private final java.lang.ClassLoader pluginClassLoader
-
instance
private static final PluginClassLoaderFactory instance
-
-
Method Detail
-
getInstance
public static PluginClassLoaderFactory getInstance()
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
create
private static final java.lang.ClassLoader create(java.io.File pluginDirectory)
Creates a Classloader that will be able to access any of the classes found in any .JAR file contained within the specified directory path, PLUS the actual Plugin directory itself, so it acts like the WEB-INF/classes directory, any class file in the directory will be accessible- Parameters:
pluginDirectory
-- Returns:
- Throws:
java.lang.IllegalArgumentException
- if the pluginDirectory is null, does not exist, or cannot be readjava.lang.RuntimeException
- if turning a File into a URL failed, which would be very unexpected
-
-