[jboss-dev-forums] [Design of POJO Server] - Re: @JMX aspect and aop/mc integration

bstansberry@jboss.com do-not-reply at jboss.com
Tue Nov 14 00:48:36 EST 2006


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#3985698

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



More information about the jboss-dev-forums mailing list