Class Retransformer

java.lang.Object
org.jboss.byteman.agent.Transformer
org.jboss.byteman.agent.Retransformer
All Implemented Interfaces:
ClassFileTransformer

public class Retransformer extends Transformer
byte code transformer used to introduce byteman events into JBoss code
  • Field Details

  • Constructor Details

    • Retransformer

      public Retransformer(Instrumentation inst, ModuleSystem moduleSystem, List<String> scriptPaths, List<String> scriptTexts, boolean isRedefine) throws Exception
      constructor allowing this transformer to be provided with access to the JVM's instrumentation implementation
      Parameters:
      inst - the instrumentation object used to interface to the JVM
      moduleSystem - the module system to use for helper and class loading
      scriptPaths - list of file paths for each input script
      scriptTexts - the text of each input script
      isRedefine - true if class redefinition is allowed false if not
      Throws:
      Exception - if a script is in error
  • Method Details

    • installScript

      public void installScript(List<String> scriptTexts, List<String> scriptNames, PrintWriter out) throws Exception
      Throws:
      Exception
    • collectAffectedNames

      protected void collectAffectedNames(List<RuleScript> ruleScripts, List<String> classList, List<String> interfaceList, List<String> superClassList, List<String> superInterfaceList)
    • listScripts

      public void listScripts(PrintWriter out) throws Exception
      Throws:
      Exception
    • removeScripts

      public void removeScripts(List<String> scriptTexts, PrintWriter out) throws Exception
      Throws:
      Exception
    • appendJarFile

      public void appendJarFile(PrintWriter out, JarFile jarfile, boolean isBoot) throws Exception
      Throws:
      Exception
    • getLoadedBootJars

      public Set<String> getLoadedBootJars()
      Returns jars that this retransformer was asked to add to the boot classloader. Note that the returned set will not include those jars that were added to the instrumentor object at startup via the -javaagent command line argument.
      Returns:
      set of jar pathnames for all jars loaded in the boot classloader
    • getLoadedSystemJars

      public Set<String> getLoadedSystemJars()
      Returns jars that this retransformer was asked to add to the system classloader. Note that the returned set will not include those jars that were added to the instrumentor object at startup via the -javaagent command line argument.
      Returns:
      set of jar pathnames for all jars loaded in the system classloader