jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java
equal
deleted
inserted
replaced
24 */ |
24 */ |
25 |
25 |
26 package sun.nio.ch; |
26 package sun.nio.ch; |
27 |
27 |
28 import java.nio.channels.spi.AsynchronousChannelProvider; |
28 import java.nio.channels.spi.AsynchronousChannelProvider; |
29 import java.security.AccessController; |
|
30 import sun.security.action.GetPropertyAction; |
29 import sun.security.action.GetPropertyAction; |
31 |
30 |
32 /** |
31 /** |
33 * Creates this platform's default asynchronous channel provider |
32 * Creates this platform's default asynchronous channel provider |
34 */ |
33 */ |
58 |
57 |
59 /** |
58 /** |
60 * Returns the default AsynchronousChannelProvider. |
59 * Returns the default AsynchronousChannelProvider. |
61 */ |
60 */ |
62 public static AsynchronousChannelProvider create() { |
61 public static AsynchronousChannelProvider create() { |
63 String osname = AccessController |
62 String osname = GetPropertyAction.getProperty("os.name"); |
64 .doPrivileged(new GetPropertyAction("os.name")); |
|
65 if (osname.equals("SunOS")) |
63 if (osname.equals("SunOS")) |
66 return createProvider("sun.nio.ch.SolarisAsynchronousChannelProvider"); |
64 return createProvider("sun.nio.ch.SolarisAsynchronousChannelProvider"); |
67 if (osname.equals("Linux")) |
65 if (osname.equals("Linux")) |
68 return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider"); |
66 return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider"); |
69 if (osname.contains("OS X")) |
67 if (osname.contains("OS X")) |