[jboss-dev-forums] [JBoss AS 7 Development] - Re: JMX-Console alternative on JBoss 7.x

Thomas Goettlich do-not-reply at jboss.com
Wed Feb 15 08:16:34 EST 2012


Thomas Goettlich [https://community.jboss.org/people/ThomasGo] created the discussion

"Re: JMX-Console alternative on JBoss 7.x"

To view the discussion, visit: https://community.jboss.org/message/716823#716823

--------------------------------------------------------------
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/ 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#716573 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
[https://community.jboss.org/message/716823#716823]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120215/7014ef70/attachment.html 


More information about the jboss-dev-forums mailing list