Package br.gov.frameworkdemoiselle.internal.implementation

Examples of br.gov.frameworkdemoiselle.internal.implementation.MBeanManager


    // Obtém o servidor MBean onde anexaremos um listener para a notificação
    MBeanServer server = ManagementFactory.getPlatformMBeanServer();

    NotificationManager notificationManager = Beans.getReference(NotificationManager.class);
    MBeanManager mBeanManager = Beans.getReference(MBeanManager.class);

    // Aqui obtemos o MBean de notificações já registrado pelo bootstrap
    StringBuffer notificationMBeanName = new StringBuffer()
        .append(config.getNotificationDomain() != null ? config.getNotificationDomain()
            : "br.gov.frameworkdemoiselle.jmx").append(":name=").append(config.getNotificationMBeanName());
    ObjectInstance instance = mBeanManager.findMBeanInstance(notificationMBeanName.toString());

    // StringBuffer vazio
    StringBuffer notificationBuffer = new StringBuffer();

    // Este notification listener será chamado quando o Demoiselle enviar a notificação e vai colocar
View Full Code Here


  /**
   * Testa se o bootstrap está corretamente carregando e registrando classes anotadas com {@link Managed} como MBeans.
   */
  @Test
  public void initializeMBean() {
    MBeanManager manager = Beans.getReference(MBeanManager.class);

    Assert.assertNotNull(manager);
    Assert.assertNotNull(manager.listRegisteredMBeans());

    // O componente demoiselle-jmx sempre tem pelo menos um MBean, que é
    // o NotificationBroadcaster. Qualquer classe gerenciada criada pelo usuário
    // será adicionada a ela, então esperamos 2 MBeans aqui.
    Assert.assertEquals(2, manager.listRegisteredMBeans().size());
   
  }
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.internal.implementation.MBeanManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.