Uploaded image for project: 'JBoss Modules'
  1. JBoss Modules
  2. MODULES-346

Introduce function-based class file transformation API

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 1.8.0.Final
    • None
    • Core
    • None

      The java.lang.instrument.ClassFileTransformer interface is hostile to JBoss Modules for two reasons. Firstly, it accepts and returns a byte[], which means that resource loaders which utilize memory mapping must copy class data an extra time even if no transformation takes place. Secondly, that interface exists in the java.instrument module which may be excluded from the run time image starting in Java 9, causing unexpected run-time errors.

      Introduce a new transformer which is a BiFunction<String, ByteBuffer, ByteBuffer> which accepts the class name and bytes (as a buffer) and returns the same buffer or a new buffer containing the transformed bytes. Deprecate the transformation properties which use java.lang.instrument.ClassFileTransformer for removal in a future version.

              dlloyd@redhat.com David Lloyd
              dlloyd@redhat.com David Lloyd
              Archiver:
              rhn-support-ceverson Clark Everson

                Created:
                Updated:
                Resolved:
                Archived: