Package org.jboss.byteman.agent
Class Retransformer
- java.lang.Object
-
- org.jboss.byteman.agent.Transformer
-
- org.jboss.byteman.agent.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 Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
bootJars
private java.util.Set<java.lang.String>
sysJars
-
Fields inherited from class org.jboss.byteman.agent.Transformer
accessEnabler, AGENT_VERSION, ALLOW_CONFIG_UPDATE, BYTEMAN_PACKAGE_PREFIX, BYTEMAN_SAMPLE_PACKAGE_PREFIX, BYTEMAN_TEST_PACKAGE_PREFIX, checkerCache, COMPILE_TO_BYTECODE, COMPILE_TO_BYTECODE_COMPATIBILITY, DEBUG, DISALLOW_DOWNCAST, DUMP_CFG, DUMP_CFG_PARTIAL, DUMP_GENERATED_CLASSES, DUMP_GENERATED_CLASSES_DIR, DUMP_GENERATED_CLASSES_INTERMEDIATE, helperManager, inst, isRedefine, JAVA_LANG_PACKAGE_PREFIX, scriptRepository, SKIP_OVERRIDE_RULES, SYSPROPS_STRICT_MODE, TRANSFORM_ALL, TRANSFORM_ALL_COMPATIBILITY, VERBOSE, VERIFY_TRANSFORMED_BYTES
-
-
Constructor Summary
Constructors Constructor Description Retransformer(java.lang.instrument.Instrumentation inst, ModuleSystem moduleSystem, java.util.List<java.lang.String> scriptPaths, java.util.List<java.lang.String> scriptTexts, boolean isRedefine)
constructor allowing this transformer to be provided with access to the JVM's instrumentation implementation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendJarFile(java.io.PrintWriter out, java.util.jar.JarFile jarfile, boolean isBoot)
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)
java.util.Set<java.lang.String>
getLoadedBootJars()
Returns jars that this retransformer was asked toadd
to the boot classloader.java.util.Set<java.lang.String>
getLoadedSystemJars()
Returns jars that this retransformer was asked toadd
to the system classloader.void
installScript(java.util.List<java.lang.String> scriptTexts, java.util.List<java.lang.String> scriptNames, java.io.PrintWriter out)
void
listScripts(java.io.PrintWriter out)
void
removeScripts(java.util.List<java.lang.String> scriptTexts, java.io.PrintWriter out)
-
Methods inherited from class org.jboss.byteman.agent.Transformer
allowConfigUpdate, computeDumpGeneratedClasses, computeDumpGeneratedClassesDir, computeDumpGeneratedClassesIntermediate, disableTriggers, disallowDowncast, dumpScript, enableTriggers, getClassChecker, getDumpGeneratedClassesDir, installBootScripts, installPolicy, isBlacklisted, isBytemanClass, isCompileToBytecode, isDebug, isDumpCFG, isDumpCFGPartial, isDumpGeneratedClasses, isDumpGeneratedClassesIntermediate, isSkipClass, isTransformable, isTriggeringEnabled, isVerbose, maybeDumpClass, maybeDumpClassIntermediate, skipOverrideRules, transform, transform, updateConfiguration
-
-
-
-
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 JVMmoduleSystem
- the module system to use for helper and class loadingscriptPaths
- list of file paths for each input scriptscriptTexts
- the text of each input scriptisRedefine
- 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 toadd
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 toadd
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
-
-