51 try {
52 return c.newInstance();
53 } catch (IllegalAccessException | InstantiationException x) {
54 throw new AssertionError(x);
55 }
56
57 }
58
59 /**
60 * Returns the default AsynchronousChannelProvider.
61 */
62 public static AsynchronousChannelProvider create() {
63 String osname = AccessController
64 .doPrivileged(new GetPropertyAction("os.name"));
65 if (osname.equals("SunOS"))
66 return createProvider("sun.nio.ch.SolarisAsynchronousChannelProvider");
67 if (osname.equals("Linux"))
68 return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider");
69 if (osname.contains("OS X"))
70 return createProvider("sun.nio.ch.BsdAsynchronousChannelProvider");
71 throw new InternalError("platform not recognized");
72 }
73 }
|
51 try {
52 return c.newInstance();
53 } catch (IllegalAccessException | InstantiationException x) {
54 throw new AssertionError(x);
55 }
56
57 }
58
59 /**
60 * Returns the default AsynchronousChannelProvider.
61 */
62 public static AsynchronousChannelProvider create() {
63 String osname = AccessController
64 .doPrivileged(new GetPropertyAction("os.name"));
65 if (osname.equals("SunOS"))
66 return createProvider("sun.nio.ch.SolarisAsynchronousChannelProvider");
67 if (osname.equals("Linux"))
68 return createProvider("sun.nio.ch.LinuxAsynchronousChannelProvider");
69 if (osname.contains("OS X"))
70 return createProvider("sun.nio.ch.BsdAsynchronousChannelProvider");
71 if (osname.equals("AIX"))
72 return createProvider("sun.nio.ch.AixAsynchronousChannelProvider");
73 throw new InternalError("platform not recognized");
74 }
75 }
|