Class ClassReloadingStrategy.Dispatcher.ForJava6CapableVm

    • Constructor Detail

      • ForJava6CapableVm

        protected ForJava6CapableVm​(Method isModifiableClass,
                                    Method isRetransformClassesSupported,
                                    Method addTransformer,
                                    Method retransformClasses)
        Creates a dispatcher for a Java 6 compatible VM.
        Parameters:
        isModifiableClass - The Instrumentation#isModifiableClass method.
        isRetransformClassesSupported - The Instrumentation#isRetransformClassesSupported method.
        addTransformer - The Instrumentation#addTransformer method.
        retransformClasses - The Instrumentation#retransformClasses method.
    • Method Detail

      • isModifiableClass

        public boolean isModifiableClass​(Instrumentation instrumentation,
                                         Class<?> type)
        Invokes the Instrumentation#isModifiableClass method.
        Specified by:
        isModifiableClass in interface ClassReloadingStrategy.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to invoke the method on.
        type - The type to consider for modifiability.
        Returns:
        true if the supplied type can be modified.
      • isRetransformClassesSupported

        public boolean isRetransformClassesSupported​(Instrumentation instrumentation)
        Invokes the Instrumentation#isRetransformClassesSupported method.
        Specified by:
        isRetransformClassesSupported in interface ClassReloadingStrategy.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to invoke the method on.
        Returns:
        true if the supplied instrumentation instance supports retransformation.
      • addTransformer

        public void addTransformer​(Instrumentation instrumentation,
                                   ClassFileTransformer classFileTransformer,
                                   boolean canRetransform)
        Registers a transformer.
        Specified by:
        addTransformer in interface ClassReloadingStrategy.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to invoke the method on.
        classFileTransformer - The class file transformer to register.
        canRetransform - true if the class file transformer should be invoked upon a retransformation.