Package javax.management

Examples of javax.management.NotificationEmitter.addNotificationListener()


    @Override public void setASysMon(ASysMonApi sysMon) {
        this.sysMon = sysMon;

        for (GarbageCollectorMXBean gcbean : ManagementFactory.getGarbageCollectorMXBeans()) {
            final NotificationEmitter emitter = (NotificationEmitter) gcbean;
            emitter.addNotificationListener(listener, null, null);
        }
    }

    @Override public void prepareMeasurements(Map<String, Object> mementos) {
    }
View Full Code Here


                        }
                    }
                };

                //Add the listener
                emitter.addNotificationListener(listener, null, null);
            }
        }
    }

    private MemoryStatus findStatus(long used, long max) {
View Full Code Here

        };
        NotificationFilter filter = null;
        Object handback = null;
        final ScanState before;
        final NotificationEmitter emitter = (NotificationEmitter)proxy;
        emitter.addNotificationListener(listener, filter, handback);
        before = proxy.getState();
        op.call();
        try {
            final Notification notification =
                    queue.poll(3000,TimeUnit.MILLISECONDS);
View Full Code Here

        NotificationFilter filter = null;
        Object handback = null;
        final ScanState before;
        final NotificationEmitter emitter = (NotificationEmitter)
                makeNotificationEmitter(proxy,DirectoryScannerMXBean.class);
        emitter.addNotificationListener(listener, filter, handback);
        before = proxy.getState();
        op.call();
        try {
            final Notification notification =
                    queue.poll(3000,TimeUnit.MILLISECONDS);
View Full Code Here

   */
  private MemoryObserver() {
    MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
    NotificationEmitter emitter = (NotificationEmitter) mbean;
    listener = new MemoryNotificationListener();
    emitter.addNotificationListener(listener, null, null);
    List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
    // activate threshhold for all those of interest
    for (MemoryPoolMXBean pool : pools) {
      // if (pool.getType() == MemoryType.HEAP) {
      if (pool.isCollectionUsageThresholdSupported()) {
View Full Code Here

                                                                    MeasurableMonitor.class,
                                                                    new ProcessMemoryMonitor());
        if(mMon instanceof ProcessMemoryMonitor) {
            NotificationEmitter emitter = (NotificationEmitter)((ProcessMemoryMonitor)mMon).getMXBean();
            jmxListener = new JMXNotificationListener();
            emitter.addNotificationListener(jmxListener, null, null);
        }
        return mMon;
    }

    public MeasurableMonitor getMeasurableMonitor() {
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.