Package net.bytebuddy.agent.builder
Class AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory
- All Implemented Interfaces:
AgentBuilder.InjectionStrategy
- Enclosing class:
AgentBuilder.InjectionStrategy.UsingUnsafe
@Enhance
public static class AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory
extends Object
implements AgentBuilder.InjectionStrategy
An injection strategy that uses a factory for creating an unsafe injector.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.InjectionStrategy
AgentBuilder.InjectionStrategy.Disabled, AgentBuilder.InjectionStrategy.UsingInstrumentation, AgentBuilder.InjectionStrategy.UsingJna, AgentBuilder.InjectionStrategy.UsingReflection, AgentBuilder.InjectionStrategy.UsingUnsafe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassInjector.UsingUnsafe.Factory
The factory to use for creating an unsafe injector. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an injection strategy based on a factory. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(ClassLoader classLoader, ProtectionDomain protectionDomain) Resolves the class injector to use for a given class loader and protection domain.
-
Field Details
-
factory
The factory to use for creating an unsafe injector.
-
-
Constructor Details
-
OfFactory
Creates an injection strategy based on a factory.- Parameters:
factory
- The factory to use for creating an unsafe injector.
-
-
Method Details
-
resolve
public ClassInjector resolve(@MaybeNull ClassLoader classLoader, @MaybeNull ProtectionDomain protectionDomain) Resolves the class injector to use for a given class loader and protection domain.- Specified by:
resolve
in interfaceAgentBuilder.InjectionStrategy
- Parameters:
classLoader
- The class loader to use ornull
if using the bootstrap loader.protectionDomain
- The protection domain to use ornull
if all privileges should be assigned.- Returns:
- The class injector to use.
-