Class Retransformer

  • All Implemented Interfaces:
    java.lang.instrument.ClassFileTransformer

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

      • sysJars

        private java.util.Set<java.lang.String> sysJars
      • bootJars

        private java.util.Set<java.lang.String> bootJars
    • Constructor Detail

      • Retransformer

        public Retransformer​(java.lang.instrument.Instrumentation inst,
                             ModuleSystem moduleSystem,
                             java.util.List<java.lang.String> scriptPaths,
                             java.util.List<java.lang.String> scriptTexts,
                             boolean isRedefine)
                      throws java.lang.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:
        java.lang.Exception - if a script is in error
    • Method Detail

      • installScript

        public void installScript​(java.util.List<java.lang.String> scriptTexts,
                                  java.util.List<java.lang.String> scriptNames,
                                  java.io.PrintWriter out)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • collectAffectedNames

        protected void collectAffectedNames​(java.util.List<RuleScript> ruleScripts,
                                            java.util.List<java.lang.String> classList,
                                            java.util.List<java.lang.String> interfaceList,
                                            java.util.List<java.lang.String> superClassList,
                                            java.util.List<java.lang.String> superInterfaceList)
      • listScripts

        public void listScripts​(java.io.PrintWriter out)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeScripts

        public void removeScripts​(java.util.List<java.lang.String> scriptTexts,
                                  java.io.PrintWriter out)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • appendJarFile

        public void appendJarFile​(java.io.PrintWriter out,
                                  java.util.jar.JarFile jarfile,
                                  boolean isBoot)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getLoadedBootJars

        public java.util.Set<java.lang.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 java.util.Set<java.lang.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