Class 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.

    • 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 accessible
      java.lang.ClassLoader getClassLoader()  
      static PluginClassLoaderFactory getInstance()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pluginClassLoader

        private final java.lang.ClassLoader pluginClassLoader
    • Constructor Detail

      • PluginClassLoaderFactory

        private PluginClassLoaderFactory()
    • Method Detail

      • 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 read
        java.lang.RuntimeException - if turning a File into a URL failed, which would be very unexpected