Package net.bytebuddy.agent
Enum ByteBuddyAgent.AgentProvider.ForByteBuddyAgent
java.lang.Object
java.lang.Enum<ByteBuddyAgent.AgentProvider.ForByteBuddyAgent>
net.bytebuddy.agent.ByteBuddyAgent.AgentProvider.ForByteBuddyAgent
- All Implemented Interfaces:
Serializable
,Comparable<ByteBuddyAgent.AgentProvider.ForByteBuddyAgent>
,java.lang.constant.Constable
,ByteBuddyAgent.AgentProvider
- Enclosing interface:
ByteBuddyAgent.AgentProvider
public static enum ByteBuddyAgent.AgentProvider.ForByteBuddyAgent
extends Enum<ByteBuddyAgent.AgentProvider.ForByteBuddyAgent>
implements ByteBuddyAgent.AgentProvider
An agent provider for a temporary Byte Buddy agent.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AgentProvider
ByteBuddyAgent.AgentProvider.ForByteBuddyAgent, ByteBuddyAgent.AgentProvider.ForExistingAgent
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The default prefix of the Byte Buddy agent jar file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static File
Creates an agent jar file containing theInstaller
class.resolve()
Provides an agent jar file for attachment.private static File
trySelfResolve
(Class<?> installer) Attempts to resolve theInstaller
class from this jar file if it can be located.Returns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Field Details
-
AGENT_FILE_NAME
The default prefix of the Byte Buddy agent jar file.- See Also:
-
-
Constructor Details
-
ForByteBuddyAgent
private ForByteBuddyAgent()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
trySelfResolve
Attempts to resolve theInstaller
class from this jar file if it can be located. Doing so, it is possible to avoid the creation of a temporary jar file which can remain undeleted on Windows operating systems where the agent is linked by a class loader such thatFile.deleteOnExit()
does not have an effect.- Parameters:
installer
- The installer class to attempt to resolve which might be a shaded version of the class.- Returns:
- This jar file's location or
null
if this jar file's location is inaccessible. - Throws:
IOException
- If an I/O exception occurs.
-
createJarFile
Creates an agent jar file containing theInstaller
class.- Returns:
- The agent jar file.
- Throws:
IOException
- If an I/O exception occurs.
-
resolve
Provides an agent jar file for attachment.- Specified by:
resolve
in interfaceByteBuddyAgent.AgentProvider
- Returns:
- The provided agent.
- Throws:
IOException
- If the agent cannot be written to disk.
-