Package org.drift.tracker.utils

Source Code of org.drift.tracker.utils.JmxUtils

package org.drift.tracker.utils;

import org.drift.tracker.jmx.MonitoringJmx;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;

/**
* @author Dima Frid
*/
public class JmxUtils {
    public static void register() {
        MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();

        try {
            mbeanServer.registerMBean(new MonitoringJmx(), new ObjectName("tracker:service=Monitoring"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
TOP

Related Classes of org.drift.tracker.utils.JmxUtils

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.