Class ClassLoaderManager

java.lang.Object
org.frankframework.configuration.ClassLoaderManager

public class ClassLoaderManager extends Object
Loads a ClassLoader on a per Configuration basis. It is possible to specify the ClassLoader type and to make ClassLoaders inherit each other. If no ClassLoader is specified the WebAppClassLoader is used, which will first try to search for resources on the basepath and then the webapp and classpath.
Author:
Niels Meijer
  • Constructor Details

    • ClassLoaderManager

      public ClassLoaderManager(IbisContext ibisContext)
  • Method Details

    • get

      public ClassLoader get(String configurationName) throws ClassLoaderException
      Returns the ClassLoader for a specific configuration.
      Parameters:
      configurationName - to get the ClassLoader for
      Returns:
      ClassLoader or null on error
      Throws:
      ClassLoaderException - when a ClassLoader failed to initialize
    • get

      public ClassLoader get(String configurationName, String classLoaderType) throws ClassLoaderException
      Returns the ClassLoader for a specific configuration. Creates the ClassLoader if it doesn't exist yet.
      Parameters:
      configurationName - to get the ClassLoader for
      classLoaderType - null or type of ClassLoader to load
      Returns:
      ClassLoader or null on error
      Throws:
      ClassLoaderException - when a ClassLoader failed to initialize
    • reload

      public void reload(String configurationName) throws ClassLoaderException
      Reloads a configuration if it exists. Does not create a new one! See reload(ClassLoader) for more information
      Throws:
      ClassLoaderException
    • reload

      public void reload(ClassLoader classLoader) throws ClassLoaderException
      Reuse class loader as it is difficult to have all references to the class loader removed (see also http://zeroturnaround.com/rebellabs/rjc201/). Create a heapdump after an unload and garbage collect and view the references to the instances of the root class loader class (BasePathClassLoader when a base path is used).
      Throws:
      ClassLoaderException
    • contains

      public boolean contains(String currentConfigurationName)
    • shutdown

      public void shutdown()
      Removes all created ClassLoaders