Package net.bytebuddy.dynamic.loading
Interface ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>
-
- Type Parameters:
S- The least specific type of class loader this strategy can apply to.
- All Superinterfaces:
ClassLoadingStrategy<S>
- All Known Implementing Classes:
ClassLoadingStrategy.Default,ClassLoadingStrategy.Default.InjectionDispatcher,ClassLoadingStrategy.Default.WrappingDispatcher
- Enclosing interface:
- ClassLoadingStrategy<T extends java.lang.ClassLoader>
public static interface ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader> extends ClassLoadingStrategy<S>
AClassLoadingStrategythat allows configuring the strategy's behavior.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>, ClassLoadingStrategy.Default, ClassLoadingStrategy.ForBootstrapInjection, ClassLoadingStrategy.ForJnaInjection, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
-
-
Field Summary
-
Fields inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
BOOTSTRAP_LOADER, NO_PROTECTION_DOMAIN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassLoadingStrategy.Configurable<S>allowExistingTypes()Determines if this class loading strategy should not throw an exception when attempting to load a class that was already loaded.ClassLoadingStrategy.Configurable<S>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<S>with(java.security.ProtectionDomain protectionDomain)Overrides the implicitly set defaultProtectionDomainwith an explicit one.ClassLoadingStrategy.Configurable<S>with(ClassLoaderDecorator.Factory classLoaderDecoratorFactory)Defines a factory that decorates a given class loader prior to class loading.ClassLoadingStrategy.Configurable<S>with(PackageDefinitionStrategy packageDefinitionStrategy)Defines the supplied package definition strategy to be used for defining packages.-
Methods inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
load
-
-
-
-
Method Detail
-
with
ClassLoadingStrategy.Configurable<S> with(java.security.ProtectionDomain protectionDomain)
Overrides the implicitly set defaultProtectionDomainwith an explicit one.- Parameters:
protectionDomain- The protection domain to apply ornullif no protection domain is set.- Returns:
- This class loading strategy with an explicitly set
ProtectionDomain.
-
with
ClassLoadingStrategy.Configurable<S> with(PackageDefinitionStrategy packageDefinitionStrategy)
Defines the supplied package definition strategy to be used for defining packages.- Parameters:
packageDefinitionStrategy- The package definer to be used.- Returns:
- A version of this class loading strategy that applies the supplied package definition strategy.
-
with
ClassLoadingStrategy.Configurable<S> with(ClassLoaderDecorator.Factory classLoaderDecoratorFactory)
Defines a factory that decorates a given class loader prior to class loading. Note that this cannot be used with injection.- Parameters:
classLoaderDecoratorFactory- The class loader decorator factory to use.- Returns:
- A version of this class loading strategy that applies the supplied class loader decorator factory.
-
allowExistingTypes
ClassLoadingStrategy.Configurable<S> allowExistingTypes()
Determines if this class loading strategy should not throw an exception when attempting to load a class that was already loaded. In this case, the already loaded class is used instead of the generated class.- Returns:
- A version of this class loading strategy that does not throw an exception when a class is already loaded.
-
opened
ClassLoadingStrategy.Configurable<S> 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.- Returns:
- A version of this class loading strategy that opens for future injections into a class loader.
-
-