From http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141090#4141090
"kabir.khan@jboss.com" wrote:
I could add something to AOP to determine if the instance annotation actually ends up resulting in more aspects (not lifecycle callbacks), and if that is the case return a proxy?
if (!params.getContainerCache().hasAspects() && !params.getContainerCache().requiresInstanceAdvisor())
{
return params.getTarget();
}
else
{
proxyClass = generateProxy(params);
}
ContainerCache cache = params.getContainerCache();
if (!cache.hasAspects() || (cache.hasAspects() && cache.hasMoreAspectsForInstanceThanInClassContainer()))
{
return params.getTarget();
}
else
{
proxyClass = generateProxy(params);
}