Class ByteBuddyAgent.AttachmentTypeEvaluator.ForJava9CapableVm

java.lang.Object
net.bytebuddy.agent.ByteBuddyAgent.AttachmentTypeEvaluator.ForJava9CapableVm
All Implemented Interfaces:
ByteBuddyAgent.AttachmentTypeEvaluator
Enclosing interface:
ByteBuddyAgent.AttachmentTypeEvaluator

public static class ByteBuddyAgent.AttachmentTypeEvaluator.ForJava9CapableVm extends Object implements ByteBuddyAgent.AttachmentTypeEvaluator
An attachment type evaluator that checks a process id against the current process id.
  • Field Details

    • current

      private final Method current
      The java.lang.ProcessHandle#current() method.
    • pid

      private final Method pid
      The java.lang.ProcessHandle#pid() method.
  • Constructor Details

    • ForJava9CapableVm

      protected ForJava9CapableVm(Method current, Method pid)
      Creates a new attachment type evaluator.
      Parameters:
      current - The java.lang.ProcessHandle#current() method.
      pid - The java.lang.ProcessHandle#pid() method.
  • Method Details

    • requiresExternalAttachment

      public boolean requiresExternalAttachment(String processId)
      Checks if the current VM requires external attachment for the supplied process id.
      Specified by:
      requiresExternalAttachment in interface ByteBuddyAgent.AttachmentTypeEvaluator
      Parameters:
      processId - The process id of the process to which to attach.
      Returns:
      true if the current VM requires external attachment for the supplied process.