methodTuple.getDeclaringClass(),
methodTuple);
tuple.signature = methodSignature;
tuple.rtti = new MethodRttiImpl(methodSignature, thisInstance, targetInstance);
MethodInfo methodInfo = JavaMethodInfo.getMethodInfo(methodTuple.getWrapperMethod());
ClassInfo withinInfo = JavaClassInfo.getClassInfo(targetClass);
ExpressionContext ctx = new ExpressionContext(PointcutType.EXECUTION, methodInfo, methodInfo);//AVAJ
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.METHOD_CALL:
methodTuple = AspectRegistry.getMethodTuple(declaringClass, joinPointHash);
methodSignature = new MethodSignatureImpl(methodTuple.getDeclaringClass(), methodTuple);
tuple.signature = methodSignature;
tuple.rtti = new MethodRttiImpl(methodSignature, thisInstance, targetInstance);
methodInfo = JavaMethodInfo.getMethodInfo(methodTuple.getWrapperMethod());
withinInfo = JavaClassInfo.getClassInfo(targetClass);
ctx = new ExpressionContext(PointcutType.CALL, methodInfo, withinInfo);
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.CONSTRUCTOR_EXECUTION:
ConstructorTuple constructorTuple = AspectRegistry.getConstructorTuple(declaringClass, joinPointHash);
ConstructorSignatureImpl constructorSignature = new ConstructorSignatureImpl(constructorTuple
.getDeclaringClass(), constructorTuple);
tuple.signature = constructorSignature;
tuple.rtti = new ConstructorRttiImpl(constructorSignature, thisInstance, targetInstance);
ConstructorInfo constructorInfo = JavaConstructorInfo.getConstructorInfo(constructorTuple
.getWrapperConstructor());
withinInfo = JavaClassInfo.getClassInfo(targetClass);
ctx = new ExpressionContext(PointcutType.EXECUTION, constructorInfo, constructorInfo);//AVAJ
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.CONSTRUCTOR_CALL:
constructorTuple = AspectRegistry.getConstructorTuple(declaringClass, joinPointHash);
constructorSignature = new ConstructorSignatureImpl(
constructorTuple.getDeclaringClass(),
constructorTuple);
tuple.signature = constructorSignature;
tuple.rtti = new ConstructorRttiImpl(constructorSignature, thisInstance, targetInstance);
constructorInfo = JavaConstructorInfo.getConstructorInfo(constructorTuple.getWrapperConstructor());
withinInfo = JavaClassInfo.getClassInfo(targetClass);
ctx = new ExpressionContext(PointcutType.CALL, constructorInfo, withinInfo);
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.FIELD_SET:
Field field = AspectRegistry.getField(declaringClass, joinPointHash);
FieldSignatureImpl fieldSignature = new FieldSignatureImpl(field.getDeclaringClass(), field);
tuple.signature = fieldSignature;
tuple.rtti = new FieldRttiImpl(fieldSignature, thisInstance, targetInstance);
FieldInfo fieldInfo = JavaFieldInfo.getFieldInfo(field);
withinInfo = JavaClassInfo.getClassInfo(targetClass);
ctx = new ExpressionContext(PointcutType.SET, fieldInfo, withinInfo);//AVAJ
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.FIELD_GET:
field = AspectRegistry.getField(declaringClass, joinPointHash);
fieldSignature = new FieldSignatureImpl(field.getDeclaringClass(), field);
tuple.signature = fieldSignature;
tuple.rtti = new FieldRttiImpl(fieldSignature, thisInstance, targetInstance);
fieldInfo = JavaFieldInfo.getFieldInfo(field);
withinInfo = JavaClassInfo.getClassInfo(targetClass);
ctx = new ExpressionContext(PointcutType.GET, fieldInfo, withinInfo);//AVAJ
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();
if (pointcut.getExpressionInfo().hasCflowPointcut()) {
cflowExpressionList.add(pointcut.getExpressionInfo().getCflowExpressionRuntime());
}
}
}
tuple.cflowExpressions = cflowExpressionList;
tuple.expressionContext = ctx;
break;
case JoinPointType.HANDLER:
CatchClauseSignatureImpl catchClauseSignature = new CatchClauseSignatureImpl(
declaringClass,
declaringClass,
"");
tuple.signature = catchClauseSignature;
tuple.rtti = new CatchClauseRttiImpl(catchClauseSignature, thisInstance, targetInstance);
ClassInfo exceptionClassInfo = JavaClassInfo.getClassInfo(declaringClass);
withinInfo = JavaClassInfo.getClassInfo(targetClass);//AVAJ within/withincode support ?
ctx = new ExpressionContext(PointcutType.HANDLER, exceptionClassInfo, withinInfo);
for (int i = 0; i < aspectManagers.length; i++) {
for (Iterator it = aspectManagers[i].getPointcuts(ctx).iterator(); it.hasNext();) {
Pointcut pointcut = (Pointcut) it.next();