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.
This is a
URLClassLoader 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
ConstructorsConstructorDescriptionChildFirstPatternClassLoader(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
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods 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 Details
-
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
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 Details
-
loadClass
Deprecated.- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
Classes.makeExtendedURLClassLoader()andClasses.ClassLoaderBuilder.setDirectLoadClasses(Predicate).