If you don't want to follow StandardMBean semantics cf. javax.management.StandardMBean rather than StandardMetadata you have to use a DynamicMBean or ModelMBean (which is what Bill's says http://jira.jboss.com/jira/browse/EJBTHREE-65) Something like the StandardMBean implementation could be used as a starting point for generating MBeanInfo from annotations rather than an interface.
ModelMBean approach: | RequiredModelMBean rmm = new RequiredModelMBean(); | rmm.setResource(object); | rmm.setModelMBeanInfo(generatedFromAnnotations()); | mbeanServer.registerMBean(rmm, objectName); | I have my reservations about the approach depending upon what you are trying to achieve. 1) If this is @Service you are essentially defining an EJB singleton which is ok. 2) It does not make sense to me to define management on normal ejb instances. EJB instances have a fleeting existance so registering them with the MBeanServer is ludricous. Also, imagine creating an MBean for every row in the database. 3) Why would you define a management interface that is not implemented by the management singleton? It seems overly complex to use annotations when it could just the StandardMBean semantic. If you weren't allowing access through an interface, the annotations would make more sense (the usual detyped jmx access through the console). 4) If all you want to do is avoid the XXXMBean rule, javax.management.StandardMBean allows you to override the interface exposed. The only requirement is that the object implements the interface. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3865973#3865973 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3865973 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ JBoss-Development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-development
