public static class ByteArrayClassLoader.ChildFirst extends ByteArrayClassLoader
A ByteArrayClassLoader
which applies child-first semantics for the
given type definitions.
Important: Package definitions remain their parent-first semantics as loaded package definitions do not expose their class loaders. Also, it is not possible to make this class or its subclass parallel-capable as the loading strategy is overridden.
Modifier and Type | Class and Description |
---|---|
protected static class |
ByteArrayClassLoader.ChildFirst.PrependingEnumeration
An enumeration that prepends an element to another enumeration and skips the last element of the provided enumeration.
|
ByteArrayClassLoader.ChildFirst, ByteArrayClassLoader.ClassDefinitionAction, ByteArrayClassLoader.EmptyEnumeration, ByteArrayClassLoader.PackageLookupStrategy, ByteArrayClassLoader.PersistenceHandler, ByteArrayClassLoader.SingletonEnumeration, ByteArrayClassLoader.SynchronizationStrategy
InjectionClassLoader.Strategy
accessControlContext, classFilePostProcessor, packageDefinitionStrategy, persistenceHandler, protectionDomain, SYNCHRONIZATION_STRATEGY, typeDefinitions, URL_SCHEMA
Constructor and Description |
---|
ChildFirst(ClassLoader parent,
boolean sealed,
Map<String,byte[]> typeDefinitions)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
boolean sealed,
Map<String,byte[]> typeDefinitions,
ByteArrayClassLoader.PersistenceHandler persistenceHandler)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
boolean sealed,
Map<String,byte[]> typeDefinitions,
ProtectionDomain protectionDomain,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
PackageDefinitionStrategy packageDefinitionStrategy)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
boolean sealed,
Map<String,byte[]> typeDefinitions,
ProtectionDomain protectionDomain,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
PackageDefinitionStrategy packageDefinitionStrategy,
ClassFilePostProcessor classFilePostProcessor)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
Map<String,byte[]> typeDefinitions)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
Map<String,byte[]> typeDefinitions,
ByteArrayClassLoader.PersistenceHandler persistenceHandler)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
Map<String,byte[]> typeDefinitions,
ProtectionDomain protectionDomain,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
PackageDefinitionStrategy packageDefinitionStrategy)
Creates a new child-first byte array class loader.
|
ChildFirst(ClassLoader parent,
Map<String,byte[]> typeDefinitions,
ProtectionDomain protectionDomain,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
PackageDefinitionStrategy packageDefinitionStrategy,
ClassFilePostProcessor classFilePostProcessor)
Creates a new child-first byte array class loader.
|
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String name) |
Enumeration<URL> |
getResources(String name) |
static Map<TypeDescription,Class<?>> |
load(ClassLoader classLoader,
Map<TypeDescription,byte[]> types)
Loads a given set of class descriptions and their binary representations using a child-first class loader.
|
static Map<TypeDescription,Class<?>> |
load(ClassLoader classLoader,
Map<TypeDescription,byte[]> types,
ProtectionDomain protectionDomain,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
PackageDefinitionStrategy packageDefinitionStrategy,
boolean forbidExisting,
boolean sealed)
Loads a given set of class descriptions and their binary representations using a child-first class loader.
|
protected Class<?> |
loadClass(String name,
boolean resolve) |
doDefineClasses, findClass, findResource, findResources
defineClass, defineClasses, isSealed, seal
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ChildFirst(@MaybeNull ClassLoader parent, Map<String,byte[]> typeDefinitions)
parent
- The ClassLoader
that is the parent of this class loader.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.public ChildFirst(@MaybeNull ClassLoader parent, boolean sealed, Map<String,byte[]> typeDefinitions)
parent
- The ClassLoader
that is the parent of this class loader.sealed
- true
if this class loader is sealed.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.public ChildFirst(@MaybeNull ClassLoader parent, Map<String,byte[]> typeDefinitions, ByteArrayClassLoader.PersistenceHandler persistenceHandler)
parent
- The ClassLoader
that is the parent of this class loader.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.persistenceHandler
- The persistence handler of this class loader.public ChildFirst(@MaybeNull ClassLoader parent, boolean sealed, Map<String,byte[]> typeDefinitions, ByteArrayClassLoader.PersistenceHandler persistenceHandler)
parent
- The ClassLoader
that is the parent of this class loader.sealed
- true
if this class loader is sealed.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.persistenceHandler
- The persistence handler of this class loader.public ChildFirst(@MaybeNull ClassLoader parent, Map<String,byte[]> typeDefinitions, @MaybeNull ProtectionDomain protectionDomain, ByteArrayClassLoader.PersistenceHandler persistenceHandler, PackageDefinitionStrategy packageDefinitionStrategy)
parent
- The ClassLoader
that is the parent of this class loader.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.protectionDomain
- The protection domain to apply where null
references an implicit protection domain.persistenceHandler
- The persistence handler of this class loader.packageDefinitionStrategy
- The package definer to be queried for package definitions.public ChildFirst(@MaybeNull ClassLoader parent, boolean sealed, Map<String,byte[]> typeDefinitions, @MaybeNull ProtectionDomain protectionDomain, ByteArrayClassLoader.PersistenceHandler persistenceHandler, PackageDefinitionStrategy packageDefinitionStrategy)
parent
- The ClassLoader
that is the parent of this class loader.sealed
- true
if this class loader is sealed.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.protectionDomain
- The protection domain to apply where null
references an implicit protection domain.persistenceHandler
- The persistence handler of this class loader.packageDefinitionStrategy
- The package definer to be queried for package definitions.public ChildFirst(@MaybeNull ClassLoader parent, Map<String,byte[]> typeDefinitions, @MaybeNull ProtectionDomain protectionDomain, ByteArrayClassLoader.PersistenceHandler persistenceHandler, PackageDefinitionStrategy packageDefinitionStrategy, ClassFilePostProcessor classFilePostProcessor)
parent
- The ClassLoader
that is the parent of this class loader.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.protectionDomain
- The protection domain to apply where null
references an implicit protection domain.persistenceHandler
- The persistence handler of this class loader.packageDefinitionStrategy
- The package definer to be queried for package definitions.classFilePostProcessor
- A post processor for class files to apply ppublic ChildFirst(@MaybeNull ClassLoader parent, boolean sealed, Map<String,byte[]> typeDefinitions, @MaybeNull ProtectionDomain protectionDomain, ByteArrayClassLoader.PersistenceHandler persistenceHandler, PackageDefinitionStrategy packageDefinitionStrategy, ClassFilePostProcessor classFilePostProcessor)
parent
- The ClassLoader
that is the parent of this class loader.sealed
- true
if this class loader is sealed.typeDefinitions
- A map of fully qualified class names pointing to their binary representations.protectionDomain
- The protection domain to apply where null
references an implicit protection domain.persistenceHandler
- The persistence handler of this class loader.packageDefinitionStrategy
- The package definer to be queried for package definitions.classFilePostProcessor
- A post processor for class files to apply ppublic static Map<TypeDescription,Class<?>> load(@MaybeNull ClassLoader classLoader, Map<TypeDescription,byte[]> types)
classLoader
- The parent class loader.types
- The unloaded types to be loaded.public static Map<TypeDescription,Class<?>> load(@MaybeNull ClassLoader classLoader, Map<TypeDescription,byte[]> types, @MaybeNull ProtectionDomain protectionDomain, ByteArrayClassLoader.PersistenceHandler persistenceHandler, PackageDefinitionStrategy packageDefinitionStrategy, boolean forbidExisting, boolean sealed)
classLoader
- The parent class loader.types
- The unloaded types to be loaded.protectionDomain
- The protection domain to apply where null
references an implicit protection domain.persistenceHandler
- The persistence handler of the created class loader.packageDefinitionStrategy
- The package definer to be queried for package definitions.forbidExisting
- true
if the class loading should throw an exception if a class was already loaded by a parent class loader.sealed
- true
if the class loader should be sealed.protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
Copyright © 2014–2024. All rights reserved.