I need to create an aspect that can be managed by JMX. The idea is to use the aspect to obtain some stats(by intercepting calls) and to use JMX console to retrieve the stats.
I created an XMBean and I added methods wich I use as advices.
Everything almost works with one exception - it seems that AOP and JMX create their own instances of the class. Aop intercepts the calls I make and updates the stats, but the XMBean values of the same stats remain the same ( null in my case).
I tried to use separate XMBean and aspect classes, but the problem is that in order to use the XMBean methods to update my stats, I have to expose them and once i do this - they are available to the users in the JMX console.
My question is - is it possible to do write an Ascpect XMBean and if so - where should I look for more details.
Thanks in advance.