Class AgentBuilder.Default.Dispatcher.ForJava6CapableVm

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.reflect.Method addTransformer
      The Instrumentation#addTransformer method.
      private java.lang.reflect.Method isNativeMethodPrefixSupported
      The Instrumentation#isNativeMethodPrefixSupported method.
      private java.lang.reflect.Method setNativeMethodPrefix
      The Instrumentation#setNativeMethodPrefix method.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ForJava6CapableVm​(java.lang.reflect.Method isNativeMethodPrefixSupported, java.lang.reflect.Method setNativeMethodPrefix, java.lang.reflect.Method addTransformer)
      Creates a new Java 6 capable dispatcher.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTransformer​(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer, boolean canRetransform)
      Adds a class file transformer to an instrumentation instance.
      boolean isNativeMethodPrefixSupported​(java.lang.instrument.Instrumentation instrumentation)
      Returns true if the supplied instrumentation instance supports setting native method prefixes.
      void setNativeMethodPrefix​(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer, java.lang.String prefix)
      Sets a native method prefix for the supplied class file transformer.
      • Methods inherited from class java.lang.Object

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

      • isNativeMethodPrefixSupported

        private final java.lang.reflect.Method isNativeMethodPrefixSupported
        The Instrumentation#isNativeMethodPrefixSupported method.
      • setNativeMethodPrefix

        private final java.lang.reflect.Method setNativeMethodPrefix
        The Instrumentation#setNativeMethodPrefix method.
      • addTransformer

        private final java.lang.reflect.Method addTransformer
        The Instrumentation#addTransformer method.
    • Constructor Detail

      • ForJava6CapableVm

        protected ForJava6CapableVm​(java.lang.reflect.Method isNativeMethodPrefixSupported,
                                    java.lang.reflect.Method setNativeMethodPrefix,
                                    java.lang.reflect.Method addTransformer)
        Creates a new Java 6 capable dispatcher.
        Parameters:
        isNativeMethodPrefixSupported - The Instrumentation#isNativeMethodPrefixSupported method.
        setNativeMethodPrefix - The Instrumentation#setNativeMethodPrefix method.
        addTransformer - The Instrumentation#addTransformer method.
    • Method Detail

      • isNativeMethodPrefixSupported

        public boolean isNativeMethodPrefixSupported​(java.lang.instrument.Instrumentation instrumentation)
        Returns true if the supplied instrumentation instance supports setting native method prefixes.
        Specified by:
        isNativeMethodPrefixSupported in interface AgentBuilder.Default.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to use.
        Returns:
        true if the supplied instrumentation instance supports native method prefixes.
      • setNativeMethodPrefix

        public void setNativeMethodPrefix​(java.lang.instrument.Instrumentation instrumentation,
                                          java.lang.instrument.ClassFileTransformer classFileTransformer,
                                          java.lang.String prefix)
        Sets a native method prefix for the supplied class file transformer.
        Specified by:
        setNativeMethodPrefix in interface AgentBuilder.Default.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to use.
        classFileTransformer - The class file transformer for which the prefix is set.
        prefix - The prefix to set.
      • addTransformer

        public void addTransformer​(java.lang.instrument.Instrumentation instrumentation,
                                   java.lang.instrument.ClassFileTransformer classFileTransformer,
                                   boolean canRetransform)
        Adds a class file transformer to an instrumentation instance.
        Specified by:
        addTransformer in interface AgentBuilder.Default.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to use for registration.
        classFileTransformer - The class file transformer to register.
        canRetransform - true if the class file transformer is capable of retransformation.