equal
deleted
inserted
replaced
32 import java.util.concurrent.*; |
32 import java.util.concurrent.*; |
33 import java.util.logging.Logger; |
33 import java.util.logging.Logger; |
34 import java.util.logging.Level; |
34 import java.util.logging.Level; |
35 import javax.net.ssl.*; |
35 import javax.net.ssl.*; |
36 import com.sun.net.httpserver.*; |
36 import com.sun.net.httpserver.*; |
|
37 import java.security.AccessController; |
|
38 import java.security.PrivilegedAction; |
37 import sun.net.httpserver.HttpConnection.State; |
39 import sun.net.httpserver.HttpConnection.State; |
38 |
40 |
39 /** |
41 /** |
40 * Provides implementation for both HTTP and HTTPS |
42 * Provides implementation for both HTTP and HTTPS |
41 */ |
43 */ |
242 contexts.remove ((HttpContextImpl)context); |
244 contexts.remove ((HttpContextImpl)context); |
243 logger.config ("context removed: " + context.getPath()); |
245 logger.config ("context removed: " + context.getPath()); |
244 } |
246 } |
245 |
247 |
246 public InetSocketAddress getAddress() { |
248 public InetSocketAddress getAddress() { |
247 return (InetSocketAddress)schan.socket().getLocalSocketAddress(); |
249 return AccessController.doPrivileged( |
|
250 new PrivilegedAction<InetSocketAddress>() { |
|
251 public InetSocketAddress run() { |
|
252 return |
|
253 (InetSocketAddress)schan.socket() |
|
254 .getLocalSocketAddress(); |
|
255 } |
|
256 }); |
248 } |
257 } |
249 |
258 |
250 Selector getSelector () { |
259 Selector getSelector () { |
251 return selector; |
260 return selector; |
252 } |
261 } |