Package org.sosy_lab.common
Class ChildFirstPatternClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- org.sosy_lab.common.ChildFirstPatternClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@Deprecated public class ChildFirstPatternClassLoader extends URLClassLoader
Deprecated.This is aURLClassLoader
that behaves like a normal class loader except that it loads some classes always by itself, even if the parent class loader would also have been available to load them.Normal class loaders follow the parent-first strategy, so they never load classes which their parent could also load. This class loader follows the child-first strategy for a specific set of classes (given by a pattern) and the parent-first strategy for the rest.
This class loader can be used if you want to load a component with its own class loader (so that it can be garbage collected independently, for example), but the parent class loader also sees the classes.
-
-
Constructor Summary
Constructors Constructor Description ChildFirstPatternClassLoader(Predicate<String> pLoadInChild, URL[] pUrls, ClassLoader pParent)
Deprecated.Create a new class loader.ChildFirstPatternClassLoader(Pattern pClassPattern, URL[] pUrls, ClassLoader pParent)
Deprecated.Create a new class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Class<?>
loadClass(String name, boolean pResolve)
Deprecated.-
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
ChildFirstPatternClassLoader
public ChildFirstPatternClassLoader(Predicate<String> pLoadInChild, URL[] pUrls, ClassLoader pParent)
Deprecated.Create a new class loader.- Parameters:
pLoadInChild
- The predicate telling which classes should never be loaded by the parent.pUrls
- The sources where this class loader should load classes from.pParent
- The parent class loader.
-
ChildFirstPatternClassLoader
public ChildFirstPatternClassLoader(Pattern pClassPattern, URL[] pUrls, ClassLoader pParent)
Deprecated.Create a new class loader.- Parameters:
pClassPattern
- The pattern telling which classes should never be loaded by the parent.pUrls
- The sources where this class loader should load classes from.pParent
- The parent class loader.
-
-
Method Detail
-
loadClass
protected Class<?> loadClass(String name, boolean pResolve) throws ClassNotFoundException
Deprecated.- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
-