Package net.bytebuddy.agent.builder
Enum AgentBuilder.InjectionStrategy.UsingUnsafe
- java.lang.Object
-
- java.lang.Enum<AgentBuilder.InjectionStrategy.UsingUnsafe>
-
- net.bytebuddy.agent.builder.AgentBuilder.InjectionStrategy.UsingUnsafe
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AgentBuilder.InjectionStrategy.UsingUnsafe>,AgentBuilder.InjectionStrategy
- Enclosing interface:
- AgentBuilder.InjectionStrategy
public static enum AgentBuilder.InjectionStrategy.UsingUnsafe extends java.lang.Enum<AgentBuilder.InjectionStrategy.UsingUnsafe> implements AgentBuilder.InjectionStrategy
An injection strategy that usessun.misc.Unsafeorjdk.internal.misc.Unsafeto inject classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAgentBuilder.InjectionStrategy.UsingUnsafe.OfFactoryAn injection strategy that uses a factory for creating an unsafe injector.-
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
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description privateUsingUnsafe()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassInjectorresolve(java.lang.ClassLoader classLoader, java.security.ProtectionDomain protectionDomain)Resolves the class injector to use for a given class loader and protection domain.static AgentBuilder.InjectionStrategy.UsingUnsafevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AgentBuilder.InjectionStrategy.UsingUnsafe[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final AgentBuilder.InjectionStrategy.UsingUnsafe INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static AgentBuilder.InjectionStrategy.UsingUnsafe[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AgentBuilder.InjectionStrategy.UsingUnsafe c : AgentBuilder.InjectionStrategy.UsingUnsafe.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AgentBuilder.InjectionStrategy.UsingUnsafe valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
resolve
public ClassInjector resolve(@MaybeNull java.lang.ClassLoader classLoader, @MaybeNull java.security.ProtectionDomain protectionDomain)
Resolves the class injector to use for a given class loader and protection domain.- Specified by:
resolvein interfaceAgentBuilder.InjectionStrategy- Parameters:
classLoader- The class loader to use ornullif using the bootstrap loader.protectionDomain- The protection domain to use ornullif all privileges should be assigned.- Returns:
- The class injector to use.
-
-