Class PluginClassLoaderFactory

java.lang.Object
org.apache.log4j.chainsaw.plugins.PluginClassLoaderFactory

public class PluginClassLoaderFactory extends 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 Details

  • Constructor Details

    • PluginClassLoaderFactory

      private PluginClassLoaderFactory()
  • Method Details

    • getInstance

      public static PluginClassLoaderFactory getInstance()
    • getClassLoader

      public ClassLoader getClassLoader()
    • create

      private static final ClassLoader create(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:
      IllegalArgumentException - if the pluginDirectory is null, does not exist, or cannot be read
      RuntimeException - if turning a File into a URL failed, which would be very unexpected