Examples of addNotificationListener()


Examples of javax.management.MBeanServer.addNotificationListener()

         ArrayList test = new ArrayList();
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_REMOVAL);
         support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
         addRelation(server, service, support, "test:type=support1");
         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         test.add(new ObjectName("test:type=test"));
         rs.sendRelationRemovalNotification("id1", test);
         on = new ObjectName("test:type=support1");
         RelationNotification rn = listener.check(1);
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

         ArrayList test = new ArrayList();
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_UPDATE);
         support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
         addRelation(server, service, support, "test:type=support1");
         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         test.add(new ObjectName("test:type=test"));
         rs.sendRoleUpdateNotification("id1", roleB1, test);
         on = new ObjectName("test:type=support1");
         RelationNotification rn = listener.check(1);
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

         ObjectName on = null;
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_UPDATE);
         support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
         addRelation(server, service, support, "test:type=support1");
         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
         rs.setRole("id1", roleCX2);
         on = new ObjectName("test:type=support1");
         RoleList shouldBe = new RoleList();
         shouldBe.add(roleC1);
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

         shouldBe.add(roleC1);
         shouldBe.add(roleCX2);
         support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
         addRelation(server, service, support, "test:type=support1");
         server.addNotificationListener(service, listener, null, null);
         RelationService rs = (RelationService) services.get(service);
           
         rs.setRoles("id1", shouldBe);
         on = new ObjectName("test:type=support1");
         compare(shouldBe, support.retrieveAllRoles());
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

   public synchronized void testRegistrationAndUnregistrationNotification() throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      MyNotificationListener listener = new MyNotificationListener();
     
      server.addNotificationListener(
            new ObjectName("JMImplementation:type=MBeanServerDelegate"),
            listener, null, null
      );      
   
      // force registration notification
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

         fail(e.toString());
      }

      try
      {
         server.addNotificationListener(testName, new RelationService(true), null, null);
      }
      catch (Exception e)
      {
         fail(e.toString());
      }
View Full Code Here

Examples of javax.management.MBeanServer.addNotificationListener()

         fail(e.toString());
      }

      try
      {
         server.addNotificationListener(test1Name, test2Name, null, null);
      }
      catch (Exception e)
      {
         fail(e.toString());
      }
View Full Code Here

Examples of javax.management.MBeanServerConnection.addNotificationListener()

        throws Exception {

        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9999/testApp");
        JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
        MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
        mbsc.addNotificationListener(
                new ObjectName("jmanage:name=TimeNotificationBroadcaster"),
                new MyNotificationListener(), null, null);

        while(true){
            try {
View Full Code Here

Examples of javax.management.MBeanServerConnection.addNotificationListener()

      ObjectName dsService = new ObjectName("jboss.test:service=DistributedStateTestCase");
      IDistributedState ds0 = (IDistributedState)
         MBeanServerInvocationHandler.newProxyInstance(server0, dsService,
         IDistributedState.class, true);
      TestListener listener0 = new TestListener();
      server0.addNotificationListener(dsService, listener0, null, null);
      ds0.put("key0", "value0");
      String value = (String) ds0.get("key0");
      log.info("server0: get(key0): "+value);
      assertEquals("server0: value == value0", "value0", value);
View Full Code Here

Examples of javax.management.MBeanServerConnection.addNotificationListener()

      log.info("server1: CurrentView, "+view1);
      IDistributedState ds1 = (IDistributedState)
         MBeanServerInvocationHandler.newProxyInstance(server1, dsService,
         IDistributedState.class, true);
      TestListener listener1 = new TestListener();
      server1.addNotificationListener(dsService, listener1, null, null);
      value = (String) ds1.get("key0");
      log.info("server1: get(key0): "+value);
      assertEquals("server1: value == value0", "value0", value);
      ds1.put("key0", "value1");
      value = (String) ds1.get("key0");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.