Object callingObject = ((CallerInvocation) invocation).getCallingObject();
// called from non-static method
if (callingObject != null)
{
Advised advised = (Advised) callingObject;
InstanceAdvisor advisor = advised._getInstanceAdvisor();
Interceptor interceptor = (Interceptor) advisor.getPerInstanceJoinpointAspect(joinpoint, aspectDefinition);
if (interceptor != null)
{
return interceptor.invoke(invocation);
}
}
}
else
{
Object targetObject = invocation.getTargetObject();
// non-static method call or non-static field call
if (targetObject != null)
{
InstanceAdvisor instanceAdvisor = getInstanceAdvisor(invocation, targetObject);
if (instanceAdvisor != null)
{
Interceptor interceptor = getAspectInstance(instanceAdvisor);
if (interceptor != null)
{