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

Introduce function-based class file transformation API

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

            dlloyd@redhat.com David Lloyd
            dlloyd@redhat.com David Lloyd
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: