|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.aop.Advisor
org.jboss.aop.ClassAdvisor
public class ClassAdvisor
Advises a class and provides access to the class's aspect chain.
Each advisable class has an associated Advisor
instance.
References methods using int
IDs rather than the actual
instances for
optimal performance. Provides ability to invoke methods on an advised
object without advice (see
Advisor.invokeWithoutAdvisement()
).
Field Summary | |
---|---|
protected Field[] |
advisedFields
|
protected HashMap |
backrefConCalledByConstructorBindings
|
protected HashMap |
backrefConCalledByMethodBindings
|
protected HashMap |
backrefMethodCalledByConstructorBindings
|
protected HashMap |
backrefMethodCalledByMethodBindings
|
protected HashMap[] |
conCalledByConBindings
|
protected HashMap[] |
conCalledByConInterceptors
|
protected gnu.trove.TLongObjectHashMap |
conCalledByMethodBindings
|
protected gnu.trove.TLongObjectHashMap |
conCalledByMethodInterceptors
|
protected boolean |
initialized
|
protected HashMap[] |
methodCalledByConBindings
|
protected HashMap[] |
methodCalledByConInterceptors
|
protected gnu.trove.TLongObjectHashMap |
methodCalledByMethodBindings
|
protected gnu.trove.TLongObjectHashMap |
methodCalledByMethodInterceptors
|
static String |
NOT_TRANSFORMABLE_SUFFIX
Suffix added to unadvised methods. |
protected gnu.trove.TLongObjectHashMap |
unadvisedMethods
|
Constructor Summary | |
---|---|
ClassAdvisor(Class clazz,
AspectManager manager)
|
|
ClassAdvisor(String classname,
AspectManager manager)
|
Method Summary | |
---|---|
void |
addClassMetaData(ClassMetaDataBinding data)
|
void |
addConstructorCallerPointcut(int callingIndex,
String calledClass,
long calledMethodHash,
AdviceBinding binding)
|
protected void |
addDeclaredMethods(Class superclass)
|
void |
attachClass(Class clazz)
Constructs a new helper. |
protected void |
bindClassMetaData(ClassMetaDataBinding data)
|
protected void |
finalizeConCalledByConInterceptorChain(ConByConInfo info)
|
protected void |
finalizeConCalledByMethodInterceptorChain(ConByMethodInfo info)
|
protected void |
finalizeFieldReadChain(ArrayList newFieldInfos)
|
protected void |
finalizeFieldWriteChain(ArrayList newFieldInfos)
|
protected void |
finalizeMethodCalledByConInterceptorChain(MethodByConInfo info)
|
protected void |
finalizeMethodCalledByMethodInterceptorChain(MethodByMethodInfo info)
|
Field[] |
getAdvisedFields()
|
gnu.trove.TLongObjectHashMap |
getAdvisedMethods()
|
HashMap[] |
getConCalledByConInterceptors()
|
gnu.trove.TLongObjectHashMap |
getConCalledByMethodInterceptors()
|
int |
getConstructorIndex(Constructor constructor)
Get a constructor's index in the class. |
Constructor[] |
getConstructors()
|
Object |
getFieldAspect(FieldJoinpoint joinpoint,
AspectDefinition def)
This method is to support PER_JOINPOINT scoping of Aspects for static fields Fields are special in that a get and set do not create separate aspect instances. |
int |
getFieldIndex(Field field)
Get a field's index in the class. |
FieldInfo[] |
getFieldReadInfos()
|
Interceptor[][] |
getFieldReadInterceptors()
Deprecated. use getFieldReadInfos instead |
FieldInfo[] |
getFieldWriteInfos()
|
Interceptor[][] |
getFieldWriteInterceptors()
Deprecated. use getFieldWriteInfos instead |
protected org.jboss.aop.InterceptorChainObserver |
getInterceptorChainObserver()
Returns the interceptor chain observer associated with this advisor. |
HashMap[] |
getMethodCalledByConInterceptors()
|
gnu.trove.TLongObjectHashMap |
getMethodCalledByMethodBindings()
|
gnu.trove.TLongObjectHashMap |
getMethodCalledByMethodInterceptors()
|
gnu.trove.TLongObjectHashMap |
getMethodInterceptors()
|
protected gnu.trove.TLongObjectHashMap |
getUnadvisedMethods()
|
protected ArrayList |
initializeFieldReadChain()
|
protected ArrayList |
initializeFieldWriteChain()
|
protected gnu.trove.TLongObjectHashMap |
initializeMethodChain()
|
Object |
invoke(Invocation invocation)
Invokes interceptor chain. |
Object |
invokeCaller(long callingMethodHash,
Object target,
Object[] args,
CallerMethodInfo info,
Object callingObject)
Deprecated. |
Object |
invokeCaller(MethodByMethodInfo info,
Object callingObject,
Object target,
Object[] args)
|
Object |
invokeConCalledByCon(ConByConInfo info,
Object[] args)
Deprecated. Prefer using the version with callingObject instead of this one,
since this object is available for call invocations made inside constructors. |
Object |
invokeConCalledByCon(ConByConInfo info,
Object callingObject,
Object[] args)
|
Object |
invokeConCalledByCon(int callingIndex,
Object[] args,
CallerConstructorInfo info)
Deprecated. |
Object |
invokeConCalledByCon(int callingIndex,
Object callingObject,
Object[] args,
CallerConstructorInfo info)
Deprecated. |
Object |
invokeConCalledByMethod(ConByMethodInfo info,
Object callingObject,
Object[] args)
|
Object |
invokeConCalledByMethod(long callingMethodHash,
Object[] args,
CallerConstructorInfo info,
Object callingObject)
Deprecated. |
Object |
invokeConstructorCaller(int callingIndex,
Object target,
Object[] args,
CallerMethodInfo info)
Deprecated. |
Object |
invokeConstructorCaller(int callingIndex,
Object callingObject,
Object target,
Object[] args,
CallerMethodInfo info)
Deprecated. |
Object |
invokeConstructorCaller(MethodByConInfo info,
Object target,
Object[] args)
Deprecated. Prefer using the version with callingObject instead of this one,
since this object is available for call invocations made inside constructors. |
Object |
invokeConstructorCaller(MethodByConInfo info,
Object callingObject,
Object target,
Object[] args)
|
Object |
invokeMethod(InstanceAdvisor instanceAdvisor,
Object target,
long methodHash,
Object[] arguments)
|
Object |
invokeMethod(InstanceAdvisor instanceAdvisor,
Object target,
long methodHash,
Object[] arguments,
MethodInfo info)
|
Object |
invokeMethod(long methodHash,
Object[] arguments)
|
Object |
invokeMethod(Object target,
long methodHash,
Object[] arguments)
|
Object |
invokeNew(Object[] args,
int idx)
|
Object |
invokeNewWithoutAdvisement(Object[] arguments,
Constructor constructor)
|
Object |
invokeRead(Object target,
int index)
Invokes interceptor chain. |
Object |
invokeWithoutAdvisement(Object target,
long methodHash,
Object[] arguments)
Invokes target object without applying interceptors. |
Object |
invokeWrite(Object target,
int index,
Object value)
Invokes interceptor chain. |
static boolean |
isAdvisable(Field field)
Is the field advisable? |
static boolean |
isAdvisable(Method method)
Is the method advisable? |
static boolean |
isGeneratedClassAdvisor(Class clazz)
|
static boolean |
isWithoutAdvisement(String name)
Is this the name of a private, unadvised thing? |
static String |
notAdvisedMethodName(String className,
String methodName)
Generates internal, unadvised version of a method name. |
protected void |
populateInterceptorsFromInfos()
Deprecated. We should just be using xxxxInfos |
protected void |
populateMixinMethods()
Put mixin methods from mixin class into unadvisedMethods map so that they can be correctly invoked upon. |
protected void |
rebindClassMetaData()
|
protected void |
rebuildCallerInterceptors()
|
protected void |
rebuildInterceptors()
|
void |
removeAdviceBinding(AdviceBinding binding)
|
void |
removeAdviceBindings(ArrayList bindings)
|
void |
removeClassMetaData(ClassMetaDataBinding data)
|
ConByMethodInfo |
resolveCallerConstructorInfo(long callingMethodHash,
String calledClass,
long calledConHash)
|
WeakReference |
resolveCallerConstructorInfoAsWeakReference(long callingMethodHash,
String calledClass,
long calledConHash)
|
MethodByMethodInfo |
resolveCallerMethodInfo(long callingMethodHash,
String calledClass,
long calledMethodHash)
|
WeakReference |
resolveCallerMethodInfoAsWeakReference(long callingMethodHash,
String calledClass,
long calledMethodHash)
|
ConByConInfo |
resolveConstructorCallerConstructorInfo(int callingIndex,
String calledClass,
long calledConHash)
|
WeakReference |
resolveConstructorCallerConstructorInfoAsWeakReference(int callingIndex,
String calledClass,
long calledConHash)
|
MethodByConInfo |
resolveConstructorCallerMethodInfo(int callingIndex,
String calledClass,
long calledMethodHash)
|
WeakReference |
resolveConstructorCallerMethodInfoAsWeakReference(int callingIndex,
String calledClass,
long calledMethodHash)
|
protected void |
setInterceptorChainObserver(org.jboss.aop.InterceptorChainObserver observer)
Defines the interceptor chain observer associated with this advisor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NOT_TRANSFORMABLE_SUFFIX
protected gnu.trove.TLongObjectHashMap unadvisedMethods
protected gnu.trove.TLongObjectHashMap methodCalledByMethodBindings
protected HashMap backrefMethodCalledByMethodBindings
protected gnu.trove.TLongObjectHashMap methodCalledByMethodInterceptors
protected gnu.trove.TLongObjectHashMap conCalledByMethodBindings
protected HashMap backrefConCalledByMethodBindings
protected gnu.trove.TLongObjectHashMap conCalledByMethodInterceptors
protected HashMap[] methodCalledByConBindings
protected HashMap[] methodCalledByConInterceptors
protected HashMap backrefMethodCalledByConstructorBindings
protected HashMap[] conCalledByConBindings
protected HashMap[] conCalledByConInterceptors
protected HashMap backrefConCalledByConstructorBindings
protected Field[] advisedFields
protected boolean initialized
Constructor Detail |
---|
public ClassAdvisor(String classname, AspectManager manager)
public ClassAdvisor(Class clazz, AspectManager manager)
Method Detail |
---|
public Object getFieldAspect(FieldJoinpoint joinpoint, AspectDefinition def)
joinpoint
- def
-
public Field[] getAdvisedFields()
public gnu.trove.TLongObjectHashMap getAdvisedMethods()
protected gnu.trove.TLongObjectHashMap getUnadvisedMethods()
public Constructor[] getConstructors()
getConstructors
in class Advisor
public gnu.trove.TLongObjectHashMap getMethodCalledByMethodInterceptors()
public HashMap[] getMethodCalledByConInterceptors()
public HashMap[] getConCalledByConInterceptors()
public gnu.trove.TLongObjectHashMap getConCalledByMethodInterceptors()
public gnu.trove.TLongObjectHashMap getMethodCalledByMethodBindings()
public Interceptor[][] getFieldReadInterceptors()
public FieldInfo[] getFieldReadInfos()
public Interceptor[][] getFieldWriteInterceptors()
public FieldInfo[] getFieldWriteInfos()
public gnu.trove.TLongObjectHashMap getMethodInterceptors()
public void attachClass(Class clazz)
public int getConstructorIndex(Constructor constructor)
public int getFieldIndex(Field field)
protected void populateMixinMethods() throws Exception
Exception
public void removeAdviceBinding(AdviceBinding binding)
removeAdviceBinding
in class Advisor
public void removeAdviceBindings(ArrayList bindings)
removeAdviceBindings
in class Advisor
protected gnu.trove.TLongObjectHashMap initializeMethodChain()
protected ArrayList initializeFieldReadChain()
protected ArrayList initializeFieldWriteChain()
protected void finalizeFieldReadChain(ArrayList newFieldInfos)
protected void finalizeFieldWriteChain(ArrayList newFieldInfos)
protected void rebuildCallerInterceptors() throws Exception
Exception
protected void finalizeMethodCalledByMethodInterceptorChain(MethodByMethodInfo info)
protected void finalizeConCalledByMethodInterceptorChain(ConByMethodInfo info)
protected void finalizeConCalledByConInterceptorChain(ConByConInfo info)
protected void finalizeMethodCalledByConInterceptorChain(MethodByConInfo info)
protected void rebuildInterceptors()
rebuildInterceptors
in class Advisor
protected void bindClassMetaData(ClassMetaDataBinding data)
protected void rebindClassMetaData()
public void addClassMetaData(ClassMetaDataBinding data)
addClassMetaData
in class Advisor
public void removeClassMetaData(ClassMetaDataBinding data)
removeClassMetaData
in class Advisor
public void addConstructorCallerPointcut(int callingIndex, String calledClass, long calledMethodHash, AdviceBinding binding) throws Exception
Exception
public static String notAdvisedMethodName(String className, String methodName)
public static boolean isWithoutAdvisement(String name)
public static boolean isAdvisable(Field field)
public static boolean isAdvisable(Method method)
protected void addDeclaredMethods(Class superclass) throws Exception
Exception
public MethodByMethodInfo resolveCallerMethodInfo(long callingMethodHash, String calledClass, long calledMethodHash)
public WeakReference resolveCallerMethodInfoAsWeakReference(long callingMethodHash, String calledClass, long calledMethodHash)
public ConByMethodInfo resolveCallerConstructorInfo(long callingMethodHash, String calledClass, long calledConHash)
public WeakReference resolveCallerConstructorInfoAsWeakReference(long callingMethodHash, String calledClass, long calledConHash)
public MethodByConInfo resolveConstructorCallerMethodInfo(int callingIndex, String calledClass, long calledMethodHash)
public WeakReference resolveConstructorCallerMethodInfoAsWeakReference(int callingIndex, String calledClass, long calledMethodHash)
public ConByConInfo resolveConstructorCallerConstructorInfo(int callingIndex, String calledClass, long calledConHash)
public WeakReference resolveConstructorCallerConstructorInfoAsWeakReference(int callingIndex, String calledClass, long calledConHash)
public Object invokeWithoutAdvisement(Object target, long methodHash, Object[] arguments) throws Throwable
Throwable
public Object invokeNewWithoutAdvisement(Object[] arguments, Constructor constructor) throws Throwable
Throwable
public Object invokeMethod(long methodHash, Object[] arguments) throws Throwable
Throwable
public Object invokeMethod(Object target, long methodHash, Object[] arguments) throws Throwable
Throwable
public Object invokeMethod(InstanceAdvisor instanceAdvisor, Object target, long methodHash, Object[] arguments) throws Throwable
Throwable
public Object invokeMethod(InstanceAdvisor instanceAdvisor, Object target, long methodHash, Object[] arguments, MethodInfo info) throws Throwable
Throwable
public Object invokeCaller(long callingMethodHash, Object target, Object[] args, CallerMethodInfo info, Object callingObject) throws Throwable
Throwable
public Object invokeCaller(MethodByMethodInfo info, Object callingObject, Object target, Object[] args) throws Throwable
Throwable
public Object invokeConCalledByMethod(long callingMethodHash, Object[] args, CallerConstructorInfo info, Object callingObject) throws Throwable
Throwable
public Object invokeConCalledByMethod(ConByMethodInfo info, Object callingObject, Object[] args) throws Throwable
Throwable
public Object invokeConstructorCaller(int callingIndex, Object target, Object[] args, CallerMethodInfo info) throws Throwable
Throwable
public Object invokeConstructorCaller(int callingIndex, Object callingObject, Object target, Object[] args, CallerMethodInfo info) throws Throwable
Throwable
public Object invokeConstructorCaller(MethodByConInfo info, Object target, Object[] args) throws Throwable
callingObject
instead of this one,
since this object is available for call invocations made inside constructors.
Throwable
invokeConstructorCaller(MethodByConInfo, Object, Object, Object[])
public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args) throws Throwable
Throwable
public Object invokeConCalledByCon(int callingIndex, Object[] args, CallerConstructorInfo info) throws Throwable
Throwable
public Object invokeConCalledByCon(int callingIndex, Object callingObject, Object[] args, CallerConstructorInfo info) throws Throwable
Throwable
public Object invokeConCalledByCon(ConByConInfo info, Object[] args) throws Throwable
callingObject
instead of this one,
since this object is available for call invocations made inside constructors.
Throwable
invokeConCalledByCon(ConByConInfo, Object, Object[])
public Object invokeConCalledByCon(ConByConInfo info, Object callingObject, Object[] args) throws Throwable
Throwable
public Object invokeNew(Object[] args, int idx) throws Throwable
Throwable
public Object invokeRead(Object target, int index) throws Throwable
Throwable
public Object invokeWrite(Object target, int index, Object value) throws Throwable
Throwable
public Object invoke(Invocation invocation) throws Throwable
Throwable
protected org.jboss.aop.InterceptorChainObserver getInterceptorChainObserver()
protected void setInterceptorChainObserver(org.jboss.aop.InterceptorChainObserver observer)
observer
- the interceptor chain observer.protected void populateInterceptorsFromInfos()
populateInterceptorsFromInfos
in class Advisor
public static boolean isGeneratedClassAdvisor(Class clazz)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |