Class ResettableClassFileTransformer.WithDelegation.WithCallback<T>

    • Method Detail

      • transform

        @MaybeNull
        public byte[] transform​(@MaybeNull
                                java.lang.ClassLoader classLoader,
                                @MaybeNull
                                java.lang.String internalName,
                                @MaybeNull
                                java.lang.Class<?> classBeingRedefined,
                                @MaybeNull
                                java.security.ProtectionDomain protectionDomain,
                                byte[] binaryRepresentation)
                         throws java.lang.instrument.IllegalClassFormatException
        Throws:
        java.lang.instrument.IllegalClassFormatException
      • transform

        @MaybeNull
        protected byte[] transform​(java.lang.Object rawModule,
                                   @MaybeNull
                                   java.lang.ClassLoader classLoader,
                                   @MaybeNull
                                   java.lang.String internalName,
                                   @MaybeNull
                                   java.lang.Class<?> classBeingRedefined,
                                   @MaybeNull
                                   java.security.ProtectionDomain protectionDomain,
                                   byte[] binaryRepresentation)
                            throws java.lang.instrument.IllegalClassFormatException
        A method to delegate to when the module system is supported on the current JVM.
        Parameters:
        rawModule - The instrumented class's java.lang.Module.
        classLoader - The type's class loader or null if the type is loaded by the bootstrap loader.
        internalName - The internal name of the instrumented class.
        classBeingRedefined - The loaded Class being redefined or null if no such class exists.
        protectionDomain - The instrumented type's protection domain or null if not available.
        binaryRepresentation - The class file of the instrumented class in its current state.
        Returns:
        The binary representation of the transformed class file or null if no transformation should be applied.
        Throws:
        java.lang.instrument.IllegalClassFormatException - If the class file was found invalid.
      • doTransform

        @MaybeNull
        protected byte[] doTransform​(java.lang.Object rawModule,
                                     @MaybeNull
                                     java.lang.ClassLoader classLoader,
                                     @MaybeNull
                                     java.lang.String internalName,
                                     @MaybeNull
                                     java.lang.Class<?> classBeingRedefined,
                                     @MaybeNull
                                     java.security.ProtectionDomain protectionDomain,
                                     byte[] binaryRepresentation)
                              throws java.lang.instrument.IllegalClassFormatException
        Callback between the transformation callbacks.
        Parameters:
        rawModule - The instrumented class's java.lang.Module.
        classLoader - The type's class loader or null if the type is loaded by the bootstrap loader.
        internalName - The internal name of the instrumented class.
        classBeingRedefined - The loaded Class being redefined or null if no such class exists.
        protectionDomain - The instrumented type's protection domain or null if not available.
        binaryRepresentation - The class file of the instrumented class in its current state.
        Returns:
        The binary representation of the transformed class file or null if no transformation should be applied.
        Throws:
        java.lang.instrument.IllegalClassFormatException - If the class file was found invalid.