Tweaking JMXIntroduction so it just directly registered my beans worked just fine. The
problem is there is no way to cleanly express that that's what I want done:
1) JMXIntroduction could just try to register context.getTarget(), catch
NotCompliantMBeanException, and then create and register the StandardMBean. Problem is
this approach ignores the @JMX.exposedInterface value -- what if the bean is Foo
implements FooMBean, Bar, and @JMX.exposedInterface=Bar.class? Kind of an edge case, but
not clean.
2) JMXIntroduction could try to register context.getTarget() only if
@JMX.exposedInterface=null. This would be a clean solution. Problem is null is not a
valid value for an annotation attribute, and the attribute type is Class, so you can't
use the "" means null trick. (Hacky idea -- make it "Class
exposedInterface() default void.class". The compiler accepts that.)
3) I tried adding another attribute "boolean registerDirectly() default false;"
to @JMX. But the deployment of any beans where it didn't specify the attribute failed
in SimpleAnnotationValidator, which makes no attempt to read default values.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985698#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...