org.jboss.aop.instrument
Class OptimizedBehaviourInvocations
java.lang.Object
org.jboss.aop.instrument.OptimizedInvocations
org.jboss.aop.instrument.OptimizedBehaviourInvocations
- Direct Known Subclasses:
- OptimizedCallerInvocations, OptimizedConstructionInvocations, OptimizedConstructorInvocations, OptimizedMethodInvocations
public abstract class OptimizedBehaviourInvocations
- extends OptimizedInvocations
Comment
- Version:
- $Revision$
- Author:
- Kabir Khan
Method Summary |
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...). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENFORCE_ARGS_CONSISTENCY
public static final String ENFORCE_ARGS_CONSISTENCY
- Name of method that enforces consistency between the values contained in typed
argument fields and those contained in arguments array.
This method is added to all optimized invocations that contain arguments field.
- See Also:
- Constant Field Values
INVOKE_TARGET
protected static final String INVOKE_TARGET
- See Also:
- Constant Field Values
OptimizedBehaviourInvocations
public OptimizedBehaviourInvocations()
setArguments
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...).
- Parameters:
length
- total number of parameters
- Returns:
- code that sets all argument fields to the values of current
behaviour parameters
addArgumentFieldsAndAccessors
protected static void addArgumentFieldsAndAccessors(javassist.ClassPool pool,
javassist.CtClass invocation,
javassist.CtClass[] params,
boolean hasMarshalledArguments)
throws javassist.NotFoundException,
javassist.CannotCompileException
- Adds typed argument fields to
invocation
and overwrites its
arguments
field accessor methods accordingly.
- Parameters:
pool
- class pool that contains invocationinvocation
- invocation class to which fields and methods
will be addedparams
- list of the parameter typeshasMarshalledArguments
- indicates whether invocation
has a
marshalled arguments field
- Throws:
javassist.NotFoundException
javassist.CannotCompileException
addDispatch
protected static void addDispatch(javassist.CtClass invocation,
String methodName,
javassist.CtClass[] params,
String dispatchLine,
String beforeDispatch,
String afterDispatch)
throws javassist.NotFoundException,
javassist.CannotCompileException
- Creates a method that dispatches execution to a joinpoint, and adds this method
to
invocation
class.
Except for its name, the generated method is constrained to have the same
signature as InvocationBase.invokeTarget()
.
- Parameters:
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)
- Throws:
javassist.NotFoundException
javassist.CannotCompileException
- See Also:
InvocationBase.invokeTarget()
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.