Class PluginClassLoaderFactory
java.lang.Object
org.apache.log4j.chainsaw.plugins.PluginClassLoaderFactory
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
FieldsModifier and TypeFieldDescriptionprivate static final PluginClassLoaderFactory
private final ClassLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static final ClassLoader
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 accessiblestatic PluginClassLoaderFactory
-
Field Details
-
pluginClassLoader
-
instance
-
-
Constructor Details
-
PluginClassLoaderFactory
private PluginClassLoaderFactory()
-
-
Method Details
-
getInstance
-
getClassLoader
-
create
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:
IllegalArgumentException
- if the pluginDirectory is null, does not exist, or cannot be readRuntimeException
- if turning a File into a URL failed, which would be very unexpected
-