JBoss Community

Re: JMX-Console alternative on JBoss 7.x

created by Thomas Goettlich in JBoss AS 7 Development - View the full discussion

Christos, using that approach might be simple but what I don't like about it is that I'd have to put the registration code into the @PostConstruct method in every MBean (we can't introduce a super class in the MBeans' hierarchy).


I found this project which uses a CDI extension for JBoss 6: http://code.google.com/p/jmx-annotations/

Here the MBeans would be singletons like in Adam's suggestion and are wrapped with a DynamicMBean instance to provide information.

The MBeans are then automatically registered in the post construct method of the injection target.


In JBoss 7, however, this doesn't work since for EJBs the injection target's postConstruct() method isn't called (see here for example: https://community.jboss.org/message/716573#716573).


Thus I adapted the usage of this project and it seems to work so far:


- MBeans are no EJBs anymore

- There is a singleton EJB that loops over all beans in the BeanManager, finds the mbeans, creates instances and registers them with the MBean server.


True, they don't run in a transactional context, but that's something we can live with.


@Daniel: how did you port your old-style MBeans to JBoss 7?

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community