Class ByteBuddyAgent.ProcessProvider.ForCurrentVm.ForJava9CapableVm

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.reflect.Method current
      The java.lang.ProcessHandle#current() method.
      private java.lang.reflect.Method pid
      The java.lang.ProcessHandle#pid() method.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ForJava9CapableVm​(java.lang.reflect.Method current, java.lang.reflect.Method pid)
      Creates a new Java 9 capable dispatcher for reading the current process's id.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ByteBuddyAgent.ProcessProvider make()
      Attempts to create a dispatcher for a Java 9 VM and falls back to a legacy dispatcher if this is not possible.
      java.lang.String resolve()
      Resolves a process id for the current JVM.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • current

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

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

      • ForJava9CapableVm

        protected ForJava9CapableVm​(java.lang.reflect.Method current,
                                    java.lang.reflect.Method pid)
        Creates a new Java 9 capable dispatcher for reading the current process's id.
        Parameters:
        current - The java.lang.ProcessHandle#current() method.
        pid - The java.lang.ProcessHandle#pid() method.
    • Method Detail

      • make

        public static ByteBuddyAgent.ProcessProvider make()
        Attempts to create a dispatcher for a Java 9 VM and falls back to a legacy dispatcher if this is not possible.
        Returns:
        A dispatcher for the current VM.
      • resolve

        public java.lang.String resolve()
        Resolves a process id for the current JVM.
        Specified by:
        resolve in interface ByteBuddyAgent.ProcessProvider
        Returns:
        The resolved process id.