org.jboss.aop
Class GeneratedClassAdvisor

java.lang.Object
  extended byorg.jboss.aop.Advisor
      extended byorg.jboss.aop.ClassAdvisor
          extended byorg.jboss.aop.GeneratedClassAdvisor

public class GeneratedClassAdvisor
extends ClassAdvisor

Comment

Version:
$Revision$
Author:
Kabir Khan

Field Summary
static String ADD_CONSTRUCTION_INFO
           
static String ADD_CONSTRUCTOR_INFO
           
static String ADD_FIELD_READ_INFO
           
static String ADD_FIELD_WRITE_INFO
           
static String ADD_METHOD_INFO
           
static String GET_PARENT_ADVISOR
           
 
Fields inherited from class org.jboss.aop.ClassAdvisor
advisedFields, backrefConCalledByConstructorBindings, backrefConCalledByMethodBindings, backrefMethodCalledByConstructorBindings, backrefMethodCalledByMethodBindings, conCalledByConBindings, conCalledByConInterceptors, conCalledByMethodBindings, conCalledByMethodInterceptors, initialized, methodCalledByConBindings, methodCalledByConInterceptors, methodCalledByMethodBindings, methodCalledByMethodInterceptors, NOT_TRANSFORMABLE_SUFFIX, unadvisedMethods
 
Fields inherited from class org.jboss.aop.Advisor
adviceBindings, adviceInterceptors, advisedMethods, annotations, aspects, classAnnotations, classMetaData, classMetaDataBindings, clazz, constructionInterceptors, constructorInterceptors, constructorMetaData, constructors, defaultMetaData, doesHaveAspects, fieldMetaData, interfaceIntroductions, manager, methodInterceptors, methodMetaData, name, perInstanceAspectDefinitions, perInstanceJoinpointAspectDefinitions
 
Constructor Summary
protected GeneratedClassAdvisor(String classname)
           
 
Method Summary
protected  void addConstructionInfo(ConstructionInfo ci)
           
protected  void addConstructorInfo(ConstructorInfo ci)
           
protected  void addFieldReadInfo(FieldInfo fi)
           
protected  void addFieldWriteInfo(FieldInfo fi)
           
protected  void addMethodInfo(MethodInfo mi)
           
 void addPerClassJoinpointAspect(AspectDefinition def, Joinpoint joinpoint)
           
protected  boolean chainOverridingForInheritedMethods()
          Whether the type of advisor supports matching on pointcut expression, where the method is defined in a superclass only, while the pointcut expression class matches the subclass.
protected  void finalizeConCalledByConInterceptorChain(ConByConInfo info)
           
protected  void finalizeConCalledByMethodInterceptorChain(ConByMethodInfo info)
           
protected  void finalizeConstructionChain(ArrayList newConstructionInfos)
           
protected  void finalizeConstructorChain(ArrayList newConstructorInfos)
           
protected  void finalizeFieldReadChain(ArrayList newFieldInfos)
           
protected  void finalizeFieldWriteChain(ArrayList newFieldInfos)
           
protected  void finalizeMethodCalledByConInterceptorChain(MethodByConInfo info)
           
protected  void finalizeMethodCalledByMethodInterceptorChain(MethodByMethodInfo info)
           
protected  void finalizeMethodChain(gnu.trove.TLongObjectHashMap newMethodInterceptors)
           
protected  ConByConJoinPointGenerator getJoinPointGenerator(ConByConInfo info)
           
protected  ConByMethodJoinPointGenerator getJoinPointGenerator(ConByMethodInfo info)
           
protected  ConstructionJoinPointGenerator getJoinPointGenerator(ConstructionInfo info)
           
protected  ConstructorJoinPointGenerator getJoinPointGenerator(ConstructorInfo info)
           
protected  FieldJoinPointGenerator getJoinPointGenerator(FieldInfo info)
           
protected  MethodByConJoinPointGenerator getJoinPointGenerator(MethodByConInfo info)
           
protected  MethodByMethodJoinPointGenerator getJoinPointGenerator(MethodByMethodInfo info)
           
protected  MethodJoinPointGenerator getJoinPointGenerator(MethodInfo info)
           
protected  GeneratedClassAdvisor getParentAdvisor()
          Generated instance advisors will override this and return the parent class advisor
 Object getPerClassAspect(AspectDefinition def)
          If this is an instance advisor, will check with parent class advisor if the aspect is already registered.
 Object getPerClassJoinpointAspect(AspectDefinition def, Joinpoint joinpoint)
          If this is an instance advisor, will check with parent class advisor if the aspect is already registered.
protected  void initialise(Class clazz, AspectManager manager)
           
protected  ArrayList initializeConstructionChain()
           
protected  ArrayList initializeConstructorChain()
           
protected  ArrayList initializeFieldReadChain()
           
protected  ArrayList initializeFieldWriteChain()
           
protected  gnu.trove.TLongObjectHashMap initializeMethodChain()
           
protected  void pointcutResolved(JoinPointInfo info, AdviceBinding binding, Joinpoint joinpoint)
          Override default behaviour of when a pointcut is matched, populate the factories since this is what is needed for generating the optimized invocation method
protected  void setParentAdvisor(GeneratedClassAdvisor parent)
          Generated InstanceAdvisors will set this
protected  void test123()
           
 String toString()
           
 
Methods inherited from class org.jboss.aop.ClassAdvisor
addClassMetaData, addConstructorCallerPointcut, addDeclaredMethods, attachClass, bindClassMetaData, getAdvisedFields, getAdvisedMethods, getConCalledByConInterceptors, getConCalledByMethodInterceptors, getConstructorIndex, getConstructors, getFieldAspect, getFieldIndex, getFieldReadInfos, getFieldReadInterceptors, getFieldWriteInfos, getFieldWriteInterceptors, getInterceptorChainObserver, getMethodCalledByConInterceptors, getMethodCalledByMethodBindings, getMethodCalledByMethodInterceptors, getMethodInterceptors, getUnadvisedMethods, invoke, invokeCaller, invokeCaller, invokeConCalledByCon, invokeConCalledByCon, invokeConCalledByMethod, invokeConCalledByMethod, invokeConstructorCaller, invokeConstructorCaller, invokeMethod, invokeMethod, invokeMethod, invokeMethod, invokeNew, invokeNewWithoutAdvisement, invokeRead, invokeWithoutAdvisement, invokeWrite, isAdvisable, isAdvisable, isGeneratedClassAdvisor, isWithoutAdvisement, notAdvisedMethodName, populateInterceptorsFromInfos, populateMixinMethods, rebindClassMetaData, rebuildCallerInterceptors, rebuildInterceptors, removeAdviceBinding, removeAdviceBindings, removeClassMetaData, resolveCallerConstructorInfo, resolveCallerConstructorInfoAsWeakReference, resolveCallerMethodInfo, resolveCallerMethodInfoAsWeakReference, resolveConstructorCallerConstructorInfo, resolveConstructorCallerConstructorInfoAsWeakReference, resolveConstructorCallerMethodInfo, resolveConstructorCallerMethodInfoAsWeakReference, setInterceptorChainObserver
 
Methods inherited from class org.jboss.aop.Advisor
addAdviceInterceptor, addInterfaceIntroduction, addPerClassAspect, addPerInstanceAspect, addPerInstanceJoinpointAspect, createInterceptorChain, deployAnnotationOverride, deployAnnotationOverrides, deployMethodAnnotationOverrides, dynamicInvoke, getAdviceInterceptor, getAllMethods, getAnnotations, getClassMetaData, getClassMetadataBindings, getClazz, getConstructionInfos, getConstructionInterceptors, getConstructorInfos, getConstructorInterceptors, getConstructorMetaData, getDefaultMetaData, getFieldMetaData, getInterfaceIntroductions, getManager, getMetadataContext, getMethodInfo, getMethodMetaData, getName, getPerClassAspect, getPerInstanceAspectDefinitions, getPerInstanceJoinpointAspectDefinitions, getSimpleName, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAspects, initializeInterfaceIntroductions, newBindingAdded, removeInterfaceIntroduction, removePerClassAspect, removePerInstanceAspect, removePerInstanceJoinpointAspect, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveConstructionPointcut, resolveConstructorPointcut, resolveMethodPointcut, setManager, setMetadataContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD_METHOD_INFO

public static final String ADD_METHOD_INFO
See Also:
Constant Field Values

ADD_CONSTRUCTOR_INFO

public static final String ADD_CONSTRUCTOR_INFO
See Also:
Constant Field Values

ADD_CONSTRUCTION_INFO

public static final String ADD_CONSTRUCTION_INFO
See Also:
Constant Field Values

ADD_FIELD_READ_INFO

public static final String ADD_FIELD_READ_INFO
See Also:
Constant Field Values

ADD_FIELD_WRITE_INFO

public static final String ADD_FIELD_WRITE_INFO
See Also:
Constant Field Values

GET_PARENT_ADVISOR

public static final String GET_PARENT_ADVISOR
See Also:
Constant Field Values
Constructor Detail

GeneratedClassAdvisor

protected GeneratedClassAdvisor(String classname)
Method Detail

initialise

protected void initialise(Class clazz,
                          AspectManager manager)

addMethodInfo

protected void addMethodInfo(MethodInfo mi)

initializeMethodChain

protected gnu.trove.TLongObjectHashMap initializeMethodChain()
Overrides:
initializeMethodChain in class ClassAdvisor

addConstructorInfo

protected void addConstructorInfo(ConstructorInfo ci)

initializeConstructorChain

protected ArrayList initializeConstructorChain()
Overrides:
initializeConstructorChain in class Advisor

addConstructionInfo

protected void addConstructionInfo(ConstructionInfo ci)

initializeConstructionChain

protected ArrayList initializeConstructionChain()
Overrides:
initializeConstructionChain in class Advisor

addFieldReadInfo

protected void addFieldReadInfo(FieldInfo fi)

initializeFieldReadChain

protected ArrayList initializeFieldReadChain()
Overrides:
initializeFieldReadChain in class ClassAdvisor

addFieldWriteInfo

protected void addFieldWriteInfo(FieldInfo fi)

initializeFieldWriteChain

protected ArrayList initializeFieldWriteChain()
Overrides:
initializeFieldWriteChain in class ClassAdvisor

finalizeMethodChain

protected void finalizeMethodChain(gnu.trove.TLongObjectHashMap newMethodInterceptors)
Overrides:
finalizeMethodChain in class Advisor

finalizeFieldReadChain

protected void finalizeFieldReadChain(ArrayList newFieldInfos)
Overrides:
finalizeFieldReadChain in class ClassAdvisor

finalizeFieldWriteChain

protected void finalizeFieldWriteChain(ArrayList newFieldInfos)
Overrides:
finalizeFieldWriteChain in class ClassAdvisor

finalizeConstructorChain

protected void finalizeConstructorChain(ArrayList newConstructorInfos)
Overrides:
finalizeConstructorChain in class Advisor

finalizeConstructionChain

protected void finalizeConstructionChain(ArrayList newConstructionInfos)
Overrides:
finalizeConstructionChain in class Advisor

finalizeMethodCalledByMethodInterceptorChain

protected void finalizeMethodCalledByMethodInterceptorChain(MethodByMethodInfo info)
Overrides:
finalizeMethodCalledByMethodInterceptorChain in class ClassAdvisor

finalizeConCalledByMethodInterceptorChain

protected void finalizeConCalledByMethodInterceptorChain(ConByMethodInfo info)
Overrides:
finalizeConCalledByMethodInterceptorChain in class ClassAdvisor

finalizeConCalledByConInterceptorChain

protected void finalizeConCalledByConInterceptorChain(ConByConInfo info)
Overrides:
finalizeConCalledByConInterceptorChain in class ClassAdvisor

finalizeMethodCalledByConInterceptorChain

protected void finalizeMethodCalledByConInterceptorChain(MethodByConInfo info)
Overrides:
finalizeMethodCalledByConInterceptorChain in class ClassAdvisor

getJoinPointGenerator

protected MethodJoinPointGenerator getJoinPointGenerator(MethodInfo info)

getJoinPointGenerator

protected FieldJoinPointGenerator getJoinPointGenerator(FieldInfo info)

test123

protected void test123()

getJoinPointGenerator

protected ConstructorJoinPointGenerator getJoinPointGenerator(ConstructorInfo info)

getJoinPointGenerator

protected ConstructionJoinPointGenerator getJoinPointGenerator(ConstructionInfo info)

getJoinPointGenerator

protected MethodByMethodJoinPointGenerator getJoinPointGenerator(MethodByMethodInfo info)

getJoinPointGenerator

protected ConByMethodJoinPointGenerator getJoinPointGenerator(ConByMethodInfo info)

getJoinPointGenerator

protected ConByConJoinPointGenerator getJoinPointGenerator(ConByConInfo info)

getJoinPointGenerator

protected MethodByConJoinPointGenerator getJoinPointGenerator(MethodByConInfo info)

pointcutResolved

protected void pointcutResolved(JoinPointInfo info,
                                AdviceBinding binding,
                                Joinpoint joinpoint)
Override default behaviour of when a pointcut is matched, populate the factories since this is what is needed for generating the optimized invocation method

Overrides:
pointcutResolved in class Advisor

toString

public String toString()

setParentAdvisor

protected void setParentAdvisor(GeneratedClassAdvisor parent)
Generated InstanceAdvisors will set this


getParentAdvisor

protected GeneratedClassAdvisor getParentAdvisor()
Generated instance advisors will override this and return the parent class advisor


getPerClassAspect

public Object getPerClassAspect(AspectDefinition def)
If this is an instance advisor, will check with parent class advisor if the aspect is already registered. If so, we should use the one from the parent advisor

Overrides:
getPerClassAspect in class Advisor

getPerClassJoinpointAspect

public Object getPerClassJoinpointAspect(AspectDefinition def,
                                         Joinpoint joinpoint)
If this is an instance advisor, will check with parent class advisor if the aspect is already registered. If so, we should use the one from the parent advisor


addPerClassJoinpointAspect

public void addPerClassJoinpointAspect(AspectDefinition def,
                                       Joinpoint joinpoint)

chainOverridingForInheritedMethods

protected boolean chainOverridingForInheritedMethods()
Description copied from class: Advisor
Whether the type of advisor supports matching on pointcut expression, where the method is defined in a superclass only, while the pointcut expression class matches the subclass. This is currently only supported for generated advisors, due to the new weaving model. So (with generated advisors) if we have

public class Super {
  void method(){}
}

public class Sub etxends Super {
}
and
<bind pointcut="execution(* Super->method())">
  <interceptor class="A"/>
</bind>
<bind pointcut="execution(* sub->method())">
  <interceptor class="B"/>
</bind>

Super.method() will be intercepted by A only
Sub.method() will be intercepted by A and B

Overrides:
chainOverridingForInheritedMethods in class Advisor
See Also:
Advisor.chainOverridingForInheritedMethods()


Copyright © 2004 JBoss Inc. All Rights Reserved.