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.
  • Enum Constant Details

  • Field Details

    • AGENT_FILE_NAME

      private static final String 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 name
      NullPointerException - if the argument is null
    • trySelfResolve

      @MaybeNull private static File trySelfResolve(Class<?> installer) throws IOException
      Attempts to resolve the Installer 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 that File.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

      private static File createJarFile() throws IOException
      Creates an agent jar file containing the Installer class.
      Returns:
      The agent jar file.
      Throws:
      IOException - If an I/O exception occurs.
    • resolve

      public File resolve() throws IOException
      Provides an agent jar file for attachment.
      Specified by:
      resolve in interface ByteBuddyAgent.AgentProvider
      Returns:
      The provided agent.
      Throws:
      IOException - If the agent cannot be written to disk.