Class InstAccess


  • public class InstAccess
    extends java.lang.Object
    Gain access using instrumentation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.io.File TEMP_JAR_DIR
      Directory for temporary jar files.
    • Constructor Summary

      Constructors 
      Constructor Description
      InstAccess()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] enhanceClass​(byte[] input)
      Method used by the instrumentation agent to enhance the target class.
      static java.lang.invoke.MethodHandle getAccessHandle()
      Acquire MethodHandle to unchecked Method AccessibleObject.setAccessible0.
      static void main​(java.lang.String[] args)
      Main class for testing.
      • Methods inherited from class java.lang.Object

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

      • TEMP_JAR_DIR

        protected static final java.io.File TEMP_JAR_DIR
        Directory for temporary jar files.
    • Constructor Detail

      • InstAccess

        public InstAccess()
    • Method Detail

      • getAccessHandle

        public static final java.lang.invoke.MethodHandle getAccessHandle()
        Acquire MethodHandle to unchecked Method AccessibleObject.setAccessible0.
        Returns:
        MethodHandle on success, null otherwise.
      • enhanceClass

        public static final byte[] enhanceClass​(byte[] input)
        Method used by the instrumentation agent to enhance the target class.
        Parameters:
        input - Original class bytecode.
        Returns:
        Enhanced class bytecode.
      • main

        public static void main​(java.lang.String[] args)
        Main class for testing.
        Parameters:
        args - Arguments.