Is it possible use AspectJ with MBeans?

In application used annotations for mark mbeans (spring annotation - managed resource). I tried to add aop for logging operations which were invoked on mbeans. But later mbeans dissappeared from jconsole mbean viewer. AFAIK it happens due AOP substitutes original class with proxy. Is it possible to keep annotations? Or only solution is to create intermediate class for mbeans?

Answers


Short answer: Yes, it is definitely possible

To determine your exact issue, we would need to see the aop and bean configuration you had/have.

When I had a similar issue to you, the problem was that my @EnableAspectJAutoProxy annotation needed proxyTargetClass set to true (default is false).

See questions/10664182 for an explanation on that setting.


Need Your Help

Has PastryKit been successfully implemented by anyone other than Apple?

javascript iphone web-applications pastrykit

Has PastryKit been successfully implemented by anyone other than Apple?

Odd Java Calendar behavior

java calendar

Does anyone understand why is the year in the output 2077 instead of 2011?