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 } |