Class AgentBuilder.Default.Dispatcher.ForJava6CapableVm

    • Constructor Detail

      • ForJava6CapableVm

        protected ForJava6CapableVm​(Method isNativeMethodPrefixSupported,
                                    Method setNativeMethodPrefix,
                                    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​(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​(Instrumentation instrumentation,
                                          ClassFileTransformer classFileTransformer,
                                          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​(Instrumentation instrumentation,
                                   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.