Package org.jboss.byteman.rule.helper
Class InterpretedHelper
java.lang.Object
org.jboss.byteman.rule.helper.Helper
org.jboss.byteman.rule.helper.InterpretedHelper
- All Implemented Interfaces:
HelperAdapter
Implementation of RuleHelper which extends the functionality of the standard helper class,
Helper, by adding the methods required to implement interface RuleHelper. It provides an
implementation which executes rules by interpreting the rule tree. Any rule which employs the
standard helper type checks built in method calls against class Helper. However, the interpreter
assumes that the helper object implements InterpretedHelper.
When a rule is compiled class Helper is extended with a generated class CompiledHelper<NNN>
which also implements interface RuleHelper. The implementation of the execute method is generated
by translating the parse tree to bytecode. Builtin calls are translated to calls of methods
defined by class Helper.
A rule can also specify its own helper class in order to provide its own set of builtin
operations. The helper class does not implement interface RuleHelper. Instead the
compilation process will generate a subclass of the user-defined helper class which
provides an appropriate implementation for the RuleHelper methods, including an implementation
of the execute method dreived from the rule parse tree. As in the default case, builtin calls
are translated to calls of methods defined by the helper class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
bind()
void
install values into the bindings map and then call the execute0 method to actually execute the ruleprotected void
execute0()
basic implementation of rule executionprivate void
fire()
getAccessibleField
(Object owner, int fieldIndex) getBinding
(String name) getName()
invokeAccessibleMethod
(Object target, Object[] args, int methodIndex) void
setAccessibleField
(Object owner, Object value, int fieldIndex) void
setBinding
(String name, Object value) private boolean
test()
Methods inherited from class org.jboss.byteman.rule.helper.Helper
activated, addCountDown, callerCheck, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, clear, clearLinks, clearLinks, closeTrace, countDown, createCountDown, createCounter, createCounter, createJoin, createLinkMap, createRendezvous, createRendezvous, createTimer, deactivated, debug, decrementCounter, delay, deleteCounter, deleteLinkMap, deleteRendezvous, deleteTimer, err, errTraceException, flag, flagged, formatAllStacks, formatAllStacks, formatAllStacks, formatAllStacks, formatStack, formatStack, formatStack, formatStack, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackRange, formatThreadStack, formatThreadStack, formatThreadStack, formatThreadStack, getCountDown, getElapsedTimeFromTimer, getObjectSize, getRendezvous, getStack, incrementCounter, incrementCounter, installed, isCountDown, isJoin, isRendezvous, joinEnlist, joinWait, joinWait, killJVM, killJVM, killThread, link, link, linked, linked, linkNames, linkNames, linkValues, linkValues, matchIndex, noisy, noisyTraceException, openTrace, openTrace, out, outTraceException, printFrame, printlnFrame, readCounter, readCounter, rendezvous, rendezvous, resetTimer, setTriggering, signalKill, signalKill, signalThrow, signalThrow, signalWake, signalWake, toString, trace, trace, traceAllStacks, traceAllStacks, traceAllStacks, traceAllStacks, traceAllStacks, traceAllStacks, traceClose, traceln, traceln, traceOpen, traceOpen, traceStack, traceStack, traceStack, traceStack, traceStack, traceStack, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackRange, traceThreadStack, traceThreadStack, traceThreadStack, traceThreadStack, traceThreadStack, traceThreadStack, triggerIndex, uninstalled, unlink, unlink, verbose, verboseTraceException, waitFor, waitFor, waiting
-
Field Details
-
bindingMap
-
-
Constructor Details
-
InterpretedHelper
-
-
Method Details
-
execute
install values into the bindings map and then call the execute0 method to actually execute the rule- Specified by:
execute
in interfaceHelperAdapter
- Parameters:
recipient
- target of trigger method or null if it is staticargs
- array to pass current values and return new values for data local to the trigger method- Throws:
ExecuteException
-
execute0
basic implementation of rule execution- Throws:
ExecuteException
- if an exception occurs during execution of the rule
-
setBinding
- Specified by:
setBinding
in interfaceHelperAdapter
-
getBinding
- Specified by:
getBinding
in interfaceHelperAdapter
-
bind
- Throws:
ExecuteException
-
test
- Throws:
ExecuteException
-
fire
- Throws:
ExecuteException
-
getName
- Specified by:
getName
in interfaceHelperAdapter
-
getAccessibleField
- Specified by:
getAccessibleField
in interfaceHelperAdapter
-
setAccessibleField
- Specified by:
setAccessibleField
in interfaceHelperAdapter
-
invokeAccessibleMethod
- Specified by:
invokeAccessibleMethod
in interfaceHelperAdapter
-