public class JMXManagementExtension implements ManagementExtension {
public void registerNotificationMBean(){
MBeanManager mbeanManager = Beans.getReference(MBeanManager.class);
JMXConfig configuration = Beans.getReference(JMXConfig.class);
StringBuffer notificationMBeanName = new StringBuffer()
.append( configuration.getNotificationDomain()!=null ? configuration.getNotificationDomain() : "br.gov.frameworkdemoiselle.jmx" )
.append(":name=")
.append(configuration.getNotificationMBeanName());
if (mbeanManager.findMBeanInstance(notificationMBeanName.toString()) == null){
NotificationEventListener listener = Beans.getReference(NotificationEventListener.class);
ObjectInstance instance = MBeanHelper.register(listener.createNotificationBroadcaster(), notificationMBeanName.toString());