"bstansberry(a)jboss.com" wrote :
| 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.
|
We could probably do some checking of the exposed interface to see if that matches the
standard mbean naming rules?
"bstansberry(a)jboss.com" wrote :
| 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.)
|
Sounds fine by me
"bstansberry(a)jboss.com" wrote :
| 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.
Default values can be read, but the java reflection api kindly does not allow us a way to
read them. If javassist is on the classpath these values can be read. Since the container
jars are in jboss/lib:
a) We need to move javassist from jboss/server/xxx/lib to jboss/lib so that the mc
classloader can see javassist
OR
b) I could do something similar to what I have done for the other AOP integration and do a
check for when javassist has been deployed.
I will look into b), but for now you should be able to make progress with a) (which is
what we might end up with anyway :-)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985741#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...