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

Introduce function-based class file transformation API

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.8.0.Final
    • Component/s: Core
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dmlloyd David Lloyd
                Reporter:
                dmlloyd David Lloyd
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: