src/java.management.rest/share/classes/javax/management/remote/rest/PlatformRestAdapter.java
branchjmx-rest-api
changeset 56003 4f7f76f6be2f
parent 56002 60ab3b595a8e
child 56005 90cff2ac77b8
equal deleted inserted replaced
56002:60ab3b595a8e 56003:4f7f76f6be2f
    71 
    71 
    72     private PlatformRestAdapter() {
    72     private PlatformRestAdapter() {
    73     }
    73     }
    74 
    74 
    75     private static class HttpThreadFactory implements ThreadFactory {
    75     private static class HttpThreadFactory implements ThreadFactory {
    76 
       
    77         private static final AtomicInteger poolNumber = new AtomicInteger(1);
       
    78         private final ThreadGroup group;
    76         private final ThreadGroup group;
    79         private final AtomicInteger threadNumber = new AtomicInteger(1);
    77         private final AtomicInteger threadNumber = new AtomicInteger(1);
    80         private final String namePrefix = "http-thread-";
    78         private final String namePrefix = "http-thread-";
    81 
    79 
    82         HttpThreadFactory() {
    80         HttpThreadFactory() {
   110      * com.sun.management.jmxremote.ssl.config.file
   108      * com.sun.management.jmxremote.ssl.config.file
   111      * javax.net.ssl.keyStore
   109      * javax.net.ssl.keyStore
   112      * javax.net.ssl.trustStore
   110      * javax.net.ssl.trustStore
   113      * javax.net.ssl.keyStorePassword
   111      * javax.net.ssl.keyStorePassword
   114      * javax.net.ssl.trustStorePassword
   112      * javax.net.ssl.trustStorePassword
   115      * @param properties    Config properties for the HTTP server.
   113      *
   116      *                      If null or if any properties are not specified, default values will be assumed.
   114      * @param properties Config properties for the HTTP server.
   117      * @throws IOException  If the server could not be created
   115      *                   If null or if any properties are not specified, default values will be assumed.
       
   116      * @throws IOException If the server could not be created
   118      */
   117      */
   119     public static synchronized void init(Properties properties) throws IOException {
   118     public static synchronized void init(Properties properties) throws IOException {
   120         if (httpServer == null) {
   119         if (httpServer == null) {
   121             if(properties == null || properties.isEmpty()) {
   120             if (properties == null || properties.isEmpty()) {
   122                 properties = new Properties();
   121                 properties = new Properties();
   123                 properties.setProperty("com.sun.management.jmxremote.ssl", "false");
   122                 properties.setProperty("com.sun.management.jmxremote.ssl", "false");
   124                 properties.setProperty("com.sun.management.jmxremote.authenticate", "false");
   123                 properties.setProperty("com.sun.management.jmxremote.authenticate", "false");
   125                 properties.setProperty("com.sun.management.jmxremote.rest.port", "0");
   124                 properties.setProperty("com.sun.management.jmxremote.rest.port", "0");
   126             }
   125             }