public abstract class ClassLoaderBase extends ClassLoader implements IConfigurationClassLoader
IConfigurationClassLoader.ReportLevel
Modifier and Type | Field and Description |
---|---|
protected org.apache.logging.log4j.Logger |
log |
CLASSPATH_RESOURCE_SCHEME
Modifier | Constructor and Description |
---|---|
protected |
ClassLoaderBase() |
protected |
ClassLoaderBase(ClassLoader parent) |
Modifier and Type | Method and Description |
---|---|
void |
configure(IbisContext ibisContext,
String configurationName)
Configure the
IConfigurationClassLoader 's implementation |
void |
destroy()
Called upon destroying (and thus removing) the IConfigurationClassLoader
|
protected boolean |
getAllowCustomClasses() |
protected String |
getBasePath()
The root directory where all resources are located.
|
String |
getConfigurationFile()
The configurationFile should only ever be found in the current classloader and never in it's parent
|
String |
getConfigurationName()
Retrieve the name of the configuration that uses this
IConfigurationClassLoader |
protected IbisContext |
getIbisContext()
Only for internal use within ClassLoaders
Retrieve the IbisContext from the ClassLoader which is set when the
configure method is called |
abstract URL |
getLocalResource(String name) |
IConfigurationClassLoader.ReportLevel |
getReportLevel() |
URL |
getResource(String name)
Override this method and make it final so nobody can overwrite it.
|
URL |
getResource(String name,
boolean useParent)
In case of the
getResources(String) we only want the local paths and not the parent path |
Enumeration<URL> |
getResources(String name) |
protected Class<?> |
loadClass(String name,
boolean resolve) |
void |
reload()
Unload the current IConfigurationClassLoader and load again upon successful unload.
|
void |
setAllowCustomClasses(boolean allow) |
void |
setBasePath(String basePath)
Sets the path prefix used when
getLocalResource() is called. |
void |
setConfigurationFile(String configurationFile) |
void |
setReportLevel(String level)
Defines the log level for errors caused by the
configure method |
String |
toString() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
protected ClassLoaderBase()
protected ClassLoaderBase(ClassLoader parent)
public void configure(IbisContext ibisContext, String configurationName) throws ClassLoaderException
IConfigurationClassLoader
IConfigurationClassLoader
's implementationconfigure
in interface IConfigurationClassLoader
ClassLoaderException
- when the IConfigurationClassLoader
's implementation cannot retrieve or load the configuration filespublic void setBasePath(String basePath)
getLocalResource()
is called.basePath
- path to use, defaults to the configuration nameprotected String getBasePath()
public String getConfigurationName()
IConfigurationClassLoader
IConfigurationClassLoader
getConfigurationName
in interface IConfigurationClassLoader
public String getConfigurationFile()
public void setConfigurationFile(String configurationFile)
protected IbisContext getIbisContext()
configure
method is calledpublic void setReportLevel(String level)
IConfigurationClassLoader
configure
methodsetReportLevel
in interface IConfigurationClassLoader
level
- ReportLevel in string format to be parsed by the ClassLoaderManager digesterpublic IConfigurationClassLoader.ReportLevel getReportLevel()
getReportLevel
in interface IConfigurationClassLoader
IConfigurationClassLoader.ReportLevel
set for this IConfigurationClassLoader
public void setAllowCustomClasses(boolean allow)
protected boolean getAllowCustomClasses()
public final URL getResource(String name)
getLocalResource(String)
getResource
in interface IConfigurationClassLoader
getResource
in class ClassLoader
public abstract URL getLocalResource(String name)
name
- of the file to search for in the current local classpathNULL
when the file cannot be foundpublic URL getResource(String name, boolean useParent)
getResources(String)
we only want the local paths and not the parent pathname
- of the file to retrieveuseParent
- only use local classpath or also traverse down the classpathNULL
public final Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public void reload() throws ClassLoaderException
IConfigurationClassLoader
reload
in interface IConfigurationClassLoader
ClassLoaderException
public void destroy()
IConfigurationClassLoader
destroy
in interface IConfigurationClassLoader
Copyright © 2023 Frank!Framework. All rights reserved.