Package javax.management.monitor

Examples of javax.management.monitor.Monitor.start()


         {
            times.set(times.get() + 1);
            holder.set(notification);
         }
      }, null, null);
      monitor.start();

      try
      {
         // Wait for notification to arrive
         while (holder.get() == null) sleep(10);
View Full Code Here


   public void testStartStopIsActive() throws Exception
   {
      Monitor monitor = createMonitor();
      monitor.setGranularityPeriod(1000);
      assertFalse(monitor.isActive());
      monitor.start();
      sleep(5000);
      assertTrue(monitor.isActive());
      monitor.stop();
      assertFalse(monitor.isActive());
      monitor.start();
View Full Code Here

      monitor.start();
      sleep(5000);
      assertTrue(monitor.isActive());
      monitor.stop();
      assertFalse(monitor.isActive());
      monitor.start();
      assertTrue(monitor.isActive());
      monitor.stop();
      assertFalse(monitor.isActive());
   }
View Full Code Here

         {
            counter.set(counter.get() + 1);
            holder.set(notification);
         }
      }, null, null);
      monitor.start();

      try
      {
         // Wait for notification to arrive
         while (holder.get() == null) sleep(10);
View Full Code Here

         {
            counter.set(counter.get() + 1);
            holder.set(notification);
         }
      }, null, null);
      monitor.start();

      try
      {
         // Wait for notification to arrive
         while (holder.get() == null) sleep(10);
View Full Code Here

         {
            times.set(times.get() + 1);
            holder.set(notification);
         }
      }, null, null);
      monitor.start();

      try
      {
         // Wait for notification to arrive
         while (holder.get() == null) sleep(10);
View Full Code Here

        ManagementFactory.getPlatformMBeanServer().registerMBean(bean, mMonitorObjectName);
       
        // add ourselves as a listener to it
        NotificationFilter nf = ep.getNotificationFilter();
        getServerConnection().addNotificationListener(mMonitorObjectName, this, nf, bean);
        bean.start();
    }

    @Override
    protected void removeNotificationListener() throws Exception {
        // remove ourselves as a listener
View Full Code Here

        ManagementFactory.getPlatformMBeanServer().registerMBean(bean, mMonitorObjectName);
       
        // add ourselves as a listener to it
        NotificationFilter nf = ep.getNotificationFilter();
        getServerConnection().addNotificationListener(mMonitorObjectName, this, nf, bean);
        bean.start();
    }

    @Override
    protected void removeNotificationListeners() throws Exception {
        // remove ourselves as a listener
View Full Code Here

                Subject subject = new Subject();
                echo(">>> RUN Principal = " + principals[i / 3]);
                subject.getPrincipals().add(new JMXPrincipal(principals[i / 3]));
                PrivilegedAction action = new PrivilegedAction() {
                    public Object run() {
                        m.start();
                        return null;
                    }
                };
                Subject.doAs(subject, action);
            }
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.