create Timer MBean - Java javax.management

Java examples for javax.management:MBean

Description

create Timer MBean

Demo Code


//package com.java2s;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.ObjectInstance;
import javax.management.JMException;

public class Main {
    private static final String TIMER_MBEAN_CLASSNAME = "javax.management.timer.Timer";

    public static ObjectInstance createTimerMBean(ObjectName name,
            MBeanServer server) throws JMException {
        return server.createMBean(TIMER_MBEAN_CLASSNAME, name, null, null);
    }//from  w  ww. j a  va 2s.  c  o  m
}

Related Tutorials