public abstract class OptimizedBehaviourInvocations extends OptimizedInvocations
Modifier and Type | Field and Description |
---|---|
static String |
ENFORCE_ARGS_CONSISTENCY
Name of method that enforces consistency between the values contained in typed
argument fields and those contained in arguments array.
|
protected static String |
INVOKE_TARGET |
Constructor and Description |
---|
OptimizedBehaviourInvocations() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addArgumentFieldsAndAccessors(javassist.ClassPool pool,
javassist.CtClass invocation,
javassist.CtClass[] params,
boolean hasMarshalledArguments)
Adds typed argument fields to
invocation and overwrites its
arguments field accessor methods accordingly. |
protected static void |
addDispatch(javassist.CtClass invocation,
String methodName,
javassist.CtClass[] params,
String dispatchLine,
String beforeDispatch,
String afterDispatch)
Creates a method that dispatches execution to a joinpoint, and adds this method
to
invocation class. |
protected static String |
setArguments(int length)
Returns a piece of code that sets all typed argument fields to the
parameter values of current behaviour (i.e., arg0 = $1; arg1 = $2...).
|
defrostClassIfExists, makeInvocationClass, makeInvocationClassNoCtors
public static final String ENFORCE_ARGS_CONSISTENCY
protected static final String INVOKE_TARGET
protected static String setArguments(int length)
length
- total number of parametersprotected static void addArgumentFieldsAndAccessors(javassist.ClassPool pool, javassist.CtClass invocation, javassist.CtClass[] params, boolean hasMarshalledArguments) throws javassist.NotFoundException, javassist.CannotCompileException
invocation
and overwrites its
arguments
field accessor methods accordingly.pool
- class pool that contains invocation
invocation
- invocation class to which fields and methods
will be addedparams
- list of the parameter typeshasMarshalledArguments
- indicates whether invocation
has a
marshalled arguments fieldjavassist.NotFoundException
javassist.CannotCompileException
protected static void addDispatch(javassist.CtClass invocation, String methodName, javassist.CtClass[] params, String dispatchLine, String beforeDispatch, String afterDispatch) throws javassist.NotFoundException, javassist.CannotCompileException
invocation
class.
InvocationBase.invokeTarget()
.invocation
- optimized invocation classmethodName
- name of the generated methoddispatchLine
- line that dispatches the execution to joinpoint. This
line must not cointain ';'
nor brackets or
the arguments list.params
- joinpoint parameters typebeforeDispatch
- one or more lines of code that should be executed before
dispatchLine
(this code must be complete,
without compilation errors)afterDispatch
- one or more lines of code that should be executed after
dispatchLine
(this code must be complete,
without compilation errors)javassist.NotFoundException
javassist.CannotCompileException
InvocationBase.invokeTarget()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.