diff options
Diffstat (limited to 'libjava/classpath/java/nio/channels')
| -rw-r--r-- | libjava/classpath/java/nio/channels/spi/SelectorProvider.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java index db4e65fe14e..b2fb7bb9c81 100644 --- a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java +++ b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java @@ -40,6 +40,7 @@ package java.nio.channels.spi; import gnu.java.nio.SelectorProviderImpl; import java.io.IOException; +import java.nio.channels.Channel; import java.nio.channels.DatagramChannel; import java.nio.channels.Pipe; import java.nio.channels.ServerSocketChannel; @@ -115,6 +116,32 @@ public abstract class SelectorProvider public abstract SocketChannel openSocketChannel() throws IOException; /** + * Returns the inherited channel of the VM. + * + * @return the inherited channel of the VM + * + * @throws IOException If an I/O error occurs + * @throws SecurityException If an installed security manager denies access + * to RuntimePermission("inheritedChannel") + * + * @since 1.5 + */ + public Channel inheritedChannel() + throws IOException + { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + { + sm.checkPermission(new RuntimePermission("inheritedChannel")); + } + // Implementation note: The default implementation can't do much more + // than return null. If a VM can provide something more useful it should + // install its own SelectorProvider (maybe a subclass of this one) to + // return something more useful. + return null; + } + + /** * Returns the system-wide default selector provider for this invocation * of the Java virtual machine. * |

