Here you can find the source of createTimerMBean(ObjectName name, MBeanServer server)
public static ObjectInstance createTimerMBean(ObjectName name, MBeanServer server) throws JMException
//package com.java2s; //License from project: LGPL 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); }/*w ww . jav a 2s . co m*/ }