Package org.frankframework.configuration
Class ClassLoaderManager
java.lang.Object
org.frankframework.configuration.ClassLoaderManager
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the ClassLoader for a specific configuration.Returns the ClassLoader for a specific configuration.void
reload
(ClassLoader classLoader) Reuse class loader as it is difficult to have all references to the class loader removed (see also http://zeroturnaround.com/rebellabs/rjc201/).void
Reloads a configuration if it exists.void
shutdown()
Removes all created ClassLoaders
-
Constructor Details
-
ClassLoaderManager
-
-
Method Details
-
get
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 forclassLoaderType
- null or type of ClassLoader to load- Returns:
- ClassLoader or null on error
- Throws:
ClassLoaderException
- when a ClassLoader failed to initialize
-
reload
Reloads a configuration if it exists. Does not create a new one! Seereload(ClassLoader)
for more information- Throws:
ClassLoaderException
-
reload
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
-
shutdown
public void shutdown()Removes all created ClassLoaders
-