Package br.gov.frameworkdemoiselle.management

Examples of br.gov.frameworkdemoiselle.management.Notification


          // Manda uma notificação de mudança de atributo
          NotificationManager notificationManager = Beans.getReference(NotificationManager.class);
          Class<? extends Object> attributeType = newValue != null ? newValue.getClass() : null;

          Notification notification = new DefaultNotification( new AttributeChangeMessage(
              bundle.getString("management-notification-attribute-changed", propertyName, managedType.getType().getCanonicalName())
              , propertyName
              , attributeType
              , oldValue
              , newValue) );
View Full Code Here


  /**
   * Test sending a notification of change in attribute
   */
  @Test
  public void sendAttributeChangeNotification() {
    Notification n = new DefaultNotification( new AttributeChangeMessage("Test Message", "attribute", String.class, "old", "new") );
    manager.sendNotification(n);
   
    DummyNotificationListener listener = Beans.getReference(DummyNotificationListener.class);
    Assert.assertEquals("Test Message - attribute", listener.getMessage());
  }
View Full Code Here

    } catch (InstanceNotFoundException e) {
      Assert.fail();
    }

    // Manda a notificação pelo Demoiselle
    Notification notification = new DefaultNotification( new AttributeChangeMessage("Attribute Changed", "name", String.class, "Demoiselle 1", "Demoiselle 2") );
    notificationManager.sendNotification(notification);

    // Se o componente funcionou, o Demoiselle propagou a notificação para o servidor MBean e o listener preencheu
    // o StringBuffer com nossa mensagem.
    Assert.assertEquals("Attribute Changed: name = Demoiselle 2", notificationBuffer.toString());
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.management.Notification

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.