[jboss-user] [JBoss AOP] - Re: AOP integration with JMX question

kabir.khan@jboss.com do-not-reply at jboss.com
Mon Jan 22 12:18:47 EST 2007


What you mention is a problem with JMX, there is no "proper" way to work around this.

One way to enforce that the values can only be set by your aspect would be to have your aspect set/clear a value in a ThreadLocal surrounding the call to invocation.invokeNext() and in the increaseCount() method of your MBean check for the exsistance of that value in the ThreadLocal. If called by the JMX console, i.e. not from the aspecy that ThreadLocal value will not exist, so it is a noop.

Alternatively, you could use the aspect instance as a parameter to the increaseCount method, which would make it impossible to invoke via the console.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4004893#4004893

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4004893

More information about the jboss-user mailing list