org.jboss.byteman.rule.compiler
Class Compiler
java.lang.Object
org.jboss.byteman.rule.compiler.Compiler
public class Compiler
- extends java.lang.Object
A class which compiles a rule by generating a subclass of the rule's helperClass which implements
the HelperAdapter interface
Field Summary |
private static int |
nextId
|
Method Summary |
private static byte[] |
compileBytes(Rule rule,
java.lang.Class helperClass,
java.lang.String helperName,
java.lang.String compiledHelperName,
boolean compileToBytecode)
|
static java.lang.Class |
getHelperAdapter(Rule rule,
java.lang.Class helperClass,
boolean compileToBytecode)
|
static java.lang.Class<?> |
loadHelperAdapter(java.lang.ClassLoader triggerClassLoader,
java.lang.String helperAdapterName,
byte[] classBytes)
dynamically load and return a generated helper adapter classes using a custom classloader derived from the
trigger class's loader |
private static int |
nextId()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nextId
private static int nextId
Compiler
public Compiler()
getHelperAdapter
public static java.lang.Class getHelperAdapter(Rule rule,
java.lang.Class helperClass,
boolean compileToBytecode)
throws CompileException
- Throws:
CompileException
compileBytes
private static byte[] compileBytes(Rule rule,
java.lang.Class helperClass,
java.lang.String helperName,
java.lang.String compiledHelperName,
boolean compileToBytecode)
throws java.lang.Exception
- Throws:
java.lang.Exception
nextId
private static int nextId()
loadHelperAdapter
public static java.lang.Class<?> loadHelperAdapter(java.lang.ClassLoader triggerClassLoader,
java.lang.String helperAdapterName,
byte[] classBytes)
- dynamically load and return a generated helper adapter classes using a custom classloader derived from the
trigger class's loader
- Parameters:
triggerClassLoader
- the class loader of the trigger class which has been matched with this
helper class's rulehelperAdapterName
- the name of the helper adaptter class to be loadedclassBytes
- the byte array defining the class
- Returns: