equal
deleted
inserted
replaced
59 import javax.management.MBeanServerConnection; |
59 import javax.management.MBeanServerConnection; |
60 import javax.management.NotificationBroadcasterSupport; |
60 import javax.management.NotificationBroadcasterSupport; |
61 import javax.management.ObjectName; |
61 import javax.management.ObjectName; |
62 import javax.management.ReflectionException; |
62 import javax.management.ReflectionException; |
63 import static javax.management.monitor.MonitorNotification.*; |
63 import static javax.management.monitor.MonitorNotification.*; |
|
64 import sun.misc.ManagedLocalsThread; |
64 |
65 |
65 /** |
66 /** |
66 * Defines the part common to all monitor MBeans. |
67 * Defines the part common to all monitor MBeans. |
67 * A monitor MBean monitors values of an attribute common to a set of observed |
68 * A monitor MBean monitors values of an attribute common to a set of observed |
68 * MBeans. The observed attribute is monitored at intervals specified by the |
69 * MBeans. The observed attribute is monitored at intervals specified by the |
1634 public ThreadGroup getThreadGroup() { |
1635 public ThreadGroup getThreadGroup() { |
1635 return group; |
1636 return group; |
1636 } |
1637 } |
1637 |
1638 |
1638 public Thread newThread(Runnable r) { |
1639 public Thread newThread(Runnable r) { |
1639 Thread t = new Thread(group, |
1640 Thread t = new ManagedLocalsThread( |
1640 r, |
1641 group, |
1641 namePrefix + |
1642 r, |
1642 threadNumber.getAndIncrement() + |
1643 namePrefix + threadNumber.getAndIncrement() + nameSuffix |
1643 nameSuffix, |
1644 ); |
1644 0); |
1645 |
1645 t.setDaemon(true); |
1646 t.setDaemon(true); |
1646 if (t.getPriority() != Thread.NORM_PRIORITY) |
1647 if (t.getPriority() != Thread.NORM_PRIORITY) |
1647 t.setPriority(Thread.NORM_PRIORITY); |
1648 t.setPriority(Thread.NORM_PRIORITY); |
1648 return t; |
1649 return t; |
1649 } |
1650 } |