Package net.bytebuddy.dynamic.loading
Interface ClassLoadingStrategy<T extends java.lang.ClassLoader>
-
- Type Parameters:
T
- The least specific type of class loader this strategy can apply to.
- All Known Subinterfaces:
ClassLoadingStrategy.Configurable<S>
- All Known Implementing Classes:
ClassLoadingStrategy.Default
,ClassLoadingStrategy.Default.InjectionDispatcher
,ClassLoadingStrategy.Default.WrappingDispatcher
,ClassLoadingStrategy.ForBootstrapInjection
,ClassLoadingStrategy.ForUnsafeInjection
,ClassLoadingStrategy.UsingLookup
,ClassReloadingStrategy
,InjectionClassLoader.Strategy
public interface ClassLoadingStrategy<T extends java.lang.ClassLoader>
A strategy for loading a collection of types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>
AClassLoadingStrategy
that allows configuring the strategy's behavior.static class
ClassLoadingStrategy.Default
This class contains implementations of default class loading strategies.static class
ClassLoadingStrategy.ForBootstrapInjection
A class loading strategy which allows class injection into the bootstrap class loader if appropriate.static class
ClassLoadingStrategy.ForUnsafeInjection
A class loading strategy that injects a class usingsun.misc.Unsafe
.static class
ClassLoadingStrategy.UsingLookup
A class loading strategy that uses ajava.lang.invoke.MethodHandles$Lookup
instance for defining types.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.ClassLoader
BOOTSTRAP_LOADER
A type-safe constant representing the bootstrap class loader which is represented bynull
within Java.static java.security.ProtectionDomain
NO_PROTECTION_DOMAIN
An undefined protection domain.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<TypeDescription,java.lang.Class<?>>
load(T classLoader, java.util.Map<TypeDescription,byte[]> types)
Loads a given collection of classes given their binary representation.
-
-
-
Field Detail
-
BOOTSTRAP_LOADER
static final java.lang.ClassLoader BOOTSTRAP_LOADER
A type-safe constant representing the bootstrap class loader which is represented bynull
within Java.
-
NO_PROTECTION_DOMAIN
static final java.security.ProtectionDomain NO_PROTECTION_DOMAIN
An undefined protection domain.
-
-
Method Detail
-
load
java.util.Map<TypeDescription,java.lang.Class<?>> load(T classLoader, java.util.Map<TypeDescription,byte[]> types)
Loads a given collection of classes given their binary representation.- Parameters:
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.- Returns:
- A collection of the loaded classes which will be initialized in the iteration order of the returned collection.
-
-