Hmm,

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
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to