Examples of Monitor


Examples of javax.management.monitor.Monitor

   }

   public void testMonitorNotificationForBadCounter() throws Exception
   {
      MBeanServer server = newMBeanServer();
      Monitor monitor = createMonitor();
      server.registerMBean(monitor, ObjectName.getInstance(":service=monitor"));

      Counter counter = new Counter();
      ObjectName counterName = ObjectName.getInstance(":mbean=counter");
      server.registerMBean(counter, counterName);

      monitor.addObservedObject(counterName);
      monitor.setGranularityPeriod(1000);
      monitor.setObservedAttribute("ObjectCounter");

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      monitor.addNotificationListener(new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            times.set(times.get() + 1);
            holder.set(notification);
         }
      }, null, null);
      monitor.start();

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

         // Be sure only one arrived
         sleep(5000);
         assertEquals(times.get(), 1);

         MonitorNotification notification = (MonitorNotification)holder.get();
         assertEquals(notification.getType(), MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR);
      }
      finally
      {
         monitor.stop();
      }
   }
View Full Code Here

Examples of mondrian.server.monitor.Monitor

    MondrianServer mondrianServer = MondrianServer.forId(null);
    if (mondrianServer != null) {
      MondrianVersion mv = mondrianServer.getVersion();

      final Monitor monitor = mondrianServer.getMonitor();
      final ServerInfo server = monitor.getServer();

      int statementCurrentlyOpenCount = 0; //server.statementCurrentlyOpenCount();
      int connectionCurrentlyOpenCount = 0; // server.connectionCurrentlyOpenCount();
      int sqlStatementCurrentlyOpenCount = 0; //server.sqlStatementCurrentlyOpenCount();
      int statementCurrentlyExecutingCount = 0; //server.statementCurrentlyExecutingCount();
      float avgCellDimensionality = (float) server.cellCoordinateCount / (float) server.cellCount;

      final List<ConnectionInfo> connections = monitor.getConnections();
      final List<StatementInfo> statements = monitor.getStatements();

      return new MondrianStats(
          server,
          mv,
          statementCurrentlyOpenCount,
View Full Code Here

Examples of net.sf.jiga.xtended.kernel.Monitor

    private Display(Image pdisplay, AffineTransform ptx) {

        super();

        setGroupMonitor(new Monitor());

        display = pdisplay;
        tx = ptx;
        loadResource();
        setPreferredSize(originalBox);
View Full Code Here

Examples of org.apache.airavata.ws.monitor.Monitor

    }

    public void monitor(final String experimentId) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        final Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,
                new EventDataListenerAdapter() {

                    @Override
                    public void notify(EventDataRepository eventDataRepo, EventData eventData) {
                        Assert.assertNotNull(eventDataRepo);
                        Assert.assertNotNull(eventData);
                        if (MonitorUtil.EventType.WORKFLOW_TERMINATED.equals(eventData.getType())) {
                            try {
                                BaseCaseIT.this.verifyOutput(experimentId, "echo_output=Airavata_Test");
                            } catch (Exception e) {
                                log.error("Error verifying output", e);
                                Assert.fail("Error occurred while verifying output.");
                            } finally {
                                getMonitor().stopMonitoring();
                            }
                        }
                        log.info("No of events: " + eventDataRepo.getEvents().size());
                    }
                });
        experimentMonitor.startMonitoring();
        experimentMonitor.waitForCompletion();
    }
View Full Code Here

Examples of org.apache.airavata.ws.monitor.Monitor

        // Creates some essential objects.

        MonitorConfiguration monitorConfiguration = new MonitorConfiguration(configuration.getBrokerURL(),
                configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
        this.monitor = new Monitor(monitorConfiguration);

        // MyProxy
        // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
        // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
        // this.configuration.getMyProxyPassphrase(), this.configuration.getMyProxyLifetime());
View Full Code Here

Examples of org.apache.airavata.xbaya.monitor.Monitor

        // Creates some essential objects.

        MonitorConfiguration monitorConfiguration = new MonitorConfiguration(configuration.getBrokerURL(),
                configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
        this.monitor = new Monitor(monitorConfiguration);

        // MyProxy
        // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
        // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
        // this.configuration.getMyProxyPassphrase(), this.configuration.getMyProxyLifetime());
View Full Code Here

Examples of org.apache.avalon.excalibur.monitor.Monitor

    public void testActiveMonitor()
        throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor activeMonitor = null;

        try
        {
            selector = (ComponentSelector)manager.lookup( Monitor.ROLE + "Selector" );
            activeMonitor = (Monitor)selector.select( "active" );
View Full Code Here

Examples of org.apache.cocoon.classloader.reloading.Monitor

     */
    public ProcessingNode build(Configuration tree, String location) throws Exception {
// TODO rcl
//        final Monitor fam = (Monitor) this.manager.lookup(Monitor.ROLE);
//        fam.setSitemapNotifier(this.processor.getWrappingProcessor());
        final Monitor fam = null;
        this.itsContainer = SitemapHelper.createContainer(
                                               tree,
                                               location,
                                               fam,
                                               (ServletContext)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT));
View Full Code Here

Examples of org.apache.cocoon.framework.Monitor

  public void init(Director director) {
    super.init(director);
    parser = (Parser)director.getActor("parser");
    logger = (Logger)director.getActor("logger");
    context = director.getActor("context");
    monitor = new Monitor(10);
    monitored_table = new Hashtable();
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.monitor.Monitor

    // that the monitor instance and the class is not garbage collected
    // See Sun's bug 4057924 in Java Developer Section 97/08/06

    Object[] keepItems = new Object[3];
    keepItems[0] = this;
    keepItems[1] = new Monitor();
    keepItems[2] = msgService;
    dontGC = new AntiGC(keepItems);

    Thread dontGCthread = getDaemonThread(dontGC, "antiGC", true);
    dontGCthread.start();
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.