Interface AgentBuilder.InstallationListener

    • Field Detail

      • SUPPRESS_ERROR

        static final java.lang.Throwable SUPPRESS_ERROR
        Indicates that an exception is handled.
    • Method Detail

      • onBeforeInstall

        void onBeforeInstall​(java.lang.instrument.Instrumentation instrumentation,
                             ResettableClassFileTransformer classFileTransformer)
        Invoked prior to the installation of a class file transformer.
        Parameters:
        instrumentation - The instrumentation on which the class file transformer is installed.
        classFileTransformer - The class file transformer that is being installed.
      • onInstall

        void onInstall​(java.lang.instrument.Instrumentation instrumentation,
                       ResettableClassFileTransformer classFileTransformer)
        Invoked upon the successful installation of a class file transformer. This method is only invoked if no error occurred during the installation or if such an error was handled by onError(Instrumentation, ResettableClassFileTransformer, Throwable).
        Parameters:
        instrumentation - The instrumentation on which the class file transformer is installed.
        classFileTransformer - The class file transformer that is being installed.
      • onError

        java.lang.Throwable onError​(java.lang.instrument.Instrumentation instrumentation,
                                    ResettableClassFileTransformer classFileTransformer,
                                    java.lang.Throwable throwable)
        Invoked if an installation causes an error. The listener has an opportunity to handle the error. This method is invoked prior to onInstall(Instrumentation, ResettableClassFileTransformer).
        Parameters:
        instrumentation - The instrumentation on which the class file transformer is installed.
        classFileTransformer - The class file transformer that is being installed.
        throwable - The throwable that causes the error.
        Returns:
        The error to propagate or null if the error is handled. Any subsequent listeners are not called if the exception is handled.
      • onReset

        void onReset​(java.lang.instrument.Instrumentation instrumentation,
                     ResettableClassFileTransformer classFileTransformer)
        Invoked if an installation is reset.
        Parameters:
        instrumentation - The instrumentation on which the class file transformer is installed.
        classFileTransformer - The class file transformer that is being installed.
      • onBeforeWarmUp

        void onBeforeWarmUp​(java.util.Set<java.lang.Class<?>> types,
                            ResettableClassFileTransformer classFileTransformer)
        Invoked before a warump is executed.
        Parameters:
        types - The types that are used for the warmup.
        classFileTransformer - The class file transformer that is warmed up.
      • onWarmUpError

        void onWarmUpError​(java.lang.Class<?> type,
                           ResettableClassFileTransformer classFileTransformer,
                           java.lang.Throwable throwable)
        Invoked when a class yields an unexpected error that is not catched by the listener.
        Parameters:
        type - The type that caused the error.
        classFileTransformer - The class file transformer that is warmed up.
        throwable - The throwable that represents the error.
      • onAfterWarmUp

        void onAfterWarmUp​(java.util.Set<java.lang.Class<?>> types,
                           ResettableClassFileTransformer classFileTransformer,
                           boolean transformed)
        Invoked after a warump is executed.
        Parameters:
        types - The types that are used for the warmup.
        classFileTransformer - The class file transformer that is warmed up.
        transformed - true if at least one class caused an actual transformation.