8147553: Remove sun.misc.ManagedLocalsThread from java.management
authorchegar
Mon, 18 Apr 2016 20:58:19 +0100
changeset 37518 cd27455e4276
parent 37517 9b2bc238b8a3
child 37519 43cd7a5e06b5
8147553: Remove sun.misc.ManagedLocalsThread from java.management Reviewed-by: dfuchs
jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java
jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java
jdk/src/java.management/share/classes/javax/management/monitor/Monitor.java
jdk/src/java.management/share/classes/module-info.java
jdk/src/java.management/share/classes/sun/management/jdp/JdpController.java
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java	Mon Apr 18 20:58:19 2016 +0100
@@ -30,7 +30,6 @@
 
 import com.sun.jmx.remote.util.ClassLogger;
 import com.sun.jmx.remote.util.EnvHelp;
-import sun.misc.ManagedLocalsThread;
 
 public abstract class ClientCommunicatorAdmin {
     private static volatile long threadNo = 1;
@@ -41,10 +40,11 @@
         if (period > 0) {
             checker = new Checker();
 
-            Thread t = new ManagedLocalsThread(
-                checker,
-                "JMX client heartbeat " +  (++threadNo)
-            );
+            Thread t = new Thread(null,
+                                  checker,
+                                  "JMX client heartbeat " +  (++threadNo),
+                                  0,
+                                  false);
 
             t.setDaemon(true);
             t.start();
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Mon Apr 18 20:58:19 2016 +0100
@@ -52,7 +52,6 @@
 import com.sun.jmx.remote.util.ClassLogger;
 import com.sun.jmx.remote.util.EnvHelp;
 import java.rmi.UnmarshalException;
-import sun.misc.ManagedLocalsThread;
 
 
 public abstract class ClientNotifForwarder {
@@ -91,7 +90,8 @@
                 throw new IllegalArgumentException("More than one command");
             this.command = command;
             if (thread == null) {
-                thread = new ManagedLocalsThread(
+                thread = new Thread(
+                    null,
                     ()-> {
                         while (true) {
                             Runnable r;
@@ -107,7 +107,9 @@
                             r.run();
                         }
                     },
-                    "ClientNotifForwarder-" + ++threadId
+                    "ClientNotifForwarder-" + ++threadId,
+                    0,
+                    false
                 );
                 thread.setDaemon(true);
                 thread.start();
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java	Mon Apr 18 20:58:19 2016 +0100
@@ -27,7 +27,6 @@
 
 
 import com.sun.jmx.remote.util.ClassLogger;
-import sun.misc.ManagedLocalsThread;
 
 public abstract class ServerCommunicatorAdmin {
     public ServerCommunicatorAdmin(long timeout) {
@@ -42,7 +41,11 @@
         timestamp = 0;
         if (timeout < Long.MAX_VALUE) {
             Runnable timeoutTask = new Timeout();
-            final Thread t = new ManagedLocalsThread(timeoutTask);
+            final Thread t = new Thread(null,
+                                        timeoutTask,
+                                        "JMX-Server-Admin-Timeout",
+                                        0,
+                                        false);
             t.setName("JMX server connection timeout " + t.getId());
             // If you change this name you will need to change a unit test
             // (NoServerTimeoutTest)
--- a/jdk/src/java.management/share/classes/javax/management/monitor/Monitor.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/javax/management/monitor/Monitor.java	Mon Apr 18 20:58:19 2016 +0100
@@ -61,7 +61,6 @@
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
 import static javax.management.monitor.MonitorNotification.*;
-import sun.misc.ManagedLocalsThread;
 
 /**
  * Defines the part common to all monitor MBeans.
@@ -1637,10 +1636,12 @@
         }
 
         public Thread newThread(Runnable r) {
-            Thread t = new ManagedLocalsThread(
+            Thread t = new Thread(
                 group,
                 r,
-                namePrefix + threadNumber.getAndIncrement() + nameSuffix
+                namePrefix + threadNumber.getAndIncrement() + nameSuffix,
+                0,
+                false
             );
 
             t.setDaemon(true);
--- a/jdk/src/java.management/share/classes/module-info.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/module-info.java	Mon Apr 18 20:58:19 2016 +0100
@@ -27,8 +27,6 @@
     requires public java.rmi;
     requires java.logging;
     requires java.naming;
-    // 8147553
-    requires jdk.unsupported;
 
     exports java.lang.management;
     exports javax.management;
--- a/jdk/src/java.management/share/classes/sun/management/jdp/JdpController.java	Mon Apr 18 19:40:48 2016 +0100
+++ b/jdk/src/java.management/share/classes/sun/management/jdp/JdpController.java	Mon Apr 18 20:58:19 2016 +0100
@@ -34,7 +34,6 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import sun.management.VMManagement;
-import sun.misc.ManagedLocalsThread;
 
 /**
  * JdpController is responsible to create and manage a broadcast loop.
@@ -219,7 +218,7 @@
 
         controller = new JDPControllerRunner(bcast, packet, pause);
 
-        Thread t = new ManagedLocalsThread(controller, "JDP broadcaster");
+        Thread t = new Thread(null, controller, "JDP broadcaster", 0, false);
         t.setDaemon(true);
         t.start();
     }