}
public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable
{
ReflectionUtils.ensureAccessible(thisMethod);
if (getInterceptionStack().contains(new MethodHolder(thisMethod, true)))
return thisMethod.invoke(target, args);
try
{
getInterceptionStack().add(new MethodHolder(thisMethod, true));
if (!thisMethod.getDeclaringClass().equals(LifecycleMixin.class))
{
if (!org.jboss.interceptor.util.InterceptionUtils.isInterceptionCandidate(thisMethod))
return thisMethod.invoke(target, args);
return executeInterception(thisMethod, args, InterceptionType.AROUND_INVOKE);
} else
{
if (thisMethod.getName().equals(InterceptionUtils.POST_CONSTRUCT))
{
return executeInterception(null, null, InterceptionType.POST_CONSTRUCT);
} else if (thisMethod.getName().equals(InterceptionUtils.PRE_DESTROY))
{
return executeInterception(null, null, InterceptionType.PRE_DESTROY);
}
}
return null;
} finally
{
getInterceptionStack().remove(new MethodHolder(thisMethod, true));
}
}