Class InstructionTransformer

java.lang.Object
de.uzl.its.swat.instrument.instruction.InstructionTransformer
All Implemented Interfaces:
ClassFileTransformer

public class InstructionTransformer extends Object implements ClassFileTransformer
An agent provides an implementation of this interface in order to transform class files. The transformation occurs before the class is defined by the JVM.
  • Constructor Details

    • InstructionTransformer

      public InstructionTransformer()
  • Method Details

    • transform

      public byte[] transform(ClassLoader loader, String cname, Class<?> classBeingRedefined, ProtectionDomain d, byte[] cbuf)
      The implementation of this method may transform the supplied class file and return a new replacement class file. Addition: Adds the InstructionClassAdapter for modifying the classFile
      Specified by:
      transform in interface ClassFileTransformer
      Parameters:
      loader - the defining loader of the class to be transformed, may be null if the bootstrap loader
      cname - the name of the class in the internal form of fully qualified class and interface names as defined in The Java Virtual Machine Specification. For example, "java/util/List".
      classBeingRedefined - if this is triggered by a redefine or retransform, the class being redefined or retransformed; if this is a class load, null
      d - the protection domain of the class being defined or redefined
      cbuf - the input byte buffer in class file format - must not be modified
      Returns:
      a well-formed class file buffer (the result of the transform), or null if no transform is performed.
    • getPrintBox

      public static PrintBox getPrintBox()