@HashCodeAndEqualsPlugin.Enhance protected static class ClassLoadingStrategy.Default.WrappingDispatcher extends java.lang.Object implements ClassLoadingStrategy.Configurable<java.lang.ClassLoader>
ProtectionDomain
on class loading.ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>, ClassLoadingStrategy.Default, ClassLoadingStrategy.ForBootstrapInjection, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
Modifier and Type | Field and Description |
---|---|
private static boolean |
CHILD_FIRST
Indicates that a child first loading strategy should be attempted.
|
private boolean |
childFirst
true if the created class loader should apply child-first semantics. |
private boolean |
forbidExisting
Determines if an exception should be thrown when attempting to load a type that already exists.
|
private PackageDefinitionStrategy |
packageDefinitionStrategy
The package definer to be used for querying information on package information.
|
private static boolean |
PARENT_FIRST
Indicates that a parent first loading strategy should be attempted.
|
private ByteArrayClassLoader.PersistenceHandler |
persistenceHandler
The persistence handler to apply.
|
private java.security.ProtectionDomain |
protectionDomain
The protection domain to apply or
null if no protection domain is set. |
private boolean |
sealed
true if the class loader should be sealed. |
BOOTSTRAP_LOADER, NO_PROTECTION_DOMAIN
Modifier | Constructor and Description |
---|---|
protected |
WrappingDispatcher(ByteArrayClassLoader.PersistenceHandler persistenceHandler,
boolean childFirst)
Creates a new wrapping dispatcher with a default protection domain and a default access control context.
|
private |
WrappingDispatcher(java.security.ProtectionDomain protectionDomain,
PackageDefinitionStrategy packageDefinitionStrategy,
ByteArrayClassLoader.PersistenceHandler persistenceHandler,
boolean childFirst,
boolean forbidExisting,
boolean sealed)
Creates a new protection domain specific class loading wrapper.
|
Modifier and Type | Method and Description |
---|---|
ClassLoadingStrategy.Configurable<java.lang.ClassLoader> |
allowExistingTypes()
Determines if this class loading strategy should not throw an exception when attempting to load a class that
was already loaded.
|
java.util.Map<TypeDescription,java.lang.Class<?>> |
load(java.lang.ClassLoader classLoader,
java.util.Map<TypeDescription,byte[]> types)
Loads a given collection of classes given their binary representation.
|
ClassLoadingStrategy.Configurable<java.lang.ClassLoader> |
opened()
With an opened class loading strategy, it is assured that types can be added to the class loader, either by
indirect injection using this strategy or by creating a class loader that explicitly supports injection.
|
ClassLoadingStrategy.Configurable<java.lang.ClassLoader> |
with(PackageDefinitionStrategy packageDefinitionStrategy)
Defines the supplied package definition strategy to be used for defining packages.
|
ClassLoadingStrategy.Configurable<java.lang.ClassLoader> |
with(java.security.ProtectionDomain protectionDomain)
Overrides the implicitly set default
ProtectionDomain with an explicit one. |
private static final boolean CHILD_FIRST
private static final boolean PARENT_FIRST
@HashCodeAndEqualsPlugin.ValueHandling(value=REVERSE_NULLABILITY) private final java.security.ProtectionDomain protectionDomain
null
if no protection domain is set.private final ByteArrayClassLoader.PersistenceHandler persistenceHandler
private final PackageDefinitionStrategy packageDefinitionStrategy
private final boolean childFirst
true
if the created class loader should apply child-first semantics.private final boolean forbidExisting
private final boolean sealed
true
if the class loader should be sealed.protected WrappingDispatcher(ByteArrayClassLoader.PersistenceHandler persistenceHandler, boolean childFirst)
persistenceHandler
- The persistence handler to apply.childFirst
- true
if the created class loader should apply child-first semantics.private WrappingDispatcher(java.security.ProtectionDomain protectionDomain, PackageDefinitionStrategy packageDefinitionStrategy, ByteArrayClassLoader.PersistenceHandler persistenceHandler, boolean childFirst, boolean forbidExisting, boolean sealed)
protectionDomain
- The protection domain to apply or null
if no protection domain is set.packageDefinitionStrategy
- The package definer to be used for querying information on package information.persistenceHandler
- The persistence handler to apply.childFirst
- true
if the created class loader should apply child-first semantics.forbidExisting
- Determines if an exception should be thrown when attempting to load a type that already exists.sealed
- true
if the class loader should be sealed.public java.util.Map<TypeDescription,java.lang.Class<?>> load(java.lang.ClassLoader classLoader, java.util.Map<TypeDescription,byte[]> types)
load
in interface ClassLoadingStrategy<java.lang.ClassLoader>
classLoader
- The class loader to used for loading the classes.types
- Byte array representations of the types to be loaded mapped by their descriptions,
where an iteration order defines an order in which they are supposed to be loaded,
if relevant.public ClassLoadingStrategy.Configurable<java.lang.ClassLoader> with(java.security.ProtectionDomain protectionDomain)
ProtectionDomain
with an explicit one.with
in interface ClassLoadingStrategy.Configurable<java.lang.ClassLoader>
protectionDomain
- The protection domain to apply or null
if no protection domain is set.ProtectionDomain
.public ClassLoadingStrategy.Configurable<java.lang.ClassLoader> with(PackageDefinitionStrategy packageDefinitionStrategy)
with
in interface ClassLoadingStrategy.Configurable<java.lang.ClassLoader>
packageDefinitionStrategy
- The package definer to be used.public ClassLoadingStrategy.Configurable<java.lang.ClassLoader> allowExistingTypes()
allowExistingTypes
in interface ClassLoadingStrategy.Configurable<java.lang.ClassLoader>
public ClassLoadingStrategy.Configurable<java.lang.ClassLoader> opened()
opened
in interface ClassLoadingStrategy.Configurable<java.lang.ClassLoader>