diff options
author | Roman Kennke <roman@kennke.org> | 2007-04-04 11:38:46 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2007-04-04 11:38:46 +0000 |
commit | 92450828067b29a757347c8f3d9c4e2d89a90205 (patch) | |
tree | bd78a7d6bc6a324c2a411de18acf2f40afb74e1b /java/nio | |
parent | 1eea75f3fa48229c0505021d1453ef905042d4fa (diff) | |
download | classpath-92450828067b29a757347c8f3d9c4e2d89a90205.tar.gz |
2007-04-04 Roman Kennke <roman@kennke.org>
* java/nio/channels/spi/SelectorProvider.java
(inheritedChannel): Make method concrete and move default impl
to here. Perform security checks as mandated by the spec.
* gnu/java/nio/SelectorProviderImpl.java
(inheritedChannel): Removed. Default impl is in SelectorProvider.
Diffstat (limited to 'java/nio')
-rw-r--r-- | java/nio/channels/spi/SelectorProvider.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/java/nio/channels/spi/SelectorProvider.java b/java/nio/channels/spi/SelectorProvider.java index bae006492..b2fb7bb9c 100644 --- a/java/nio/channels/spi/SelectorProvider.java +++ b/java/nio/channels/spi/SelectorProvider.java @@ -126,7 +126,20 @@ public abstract class SelectorProvider * * @since 1.5 */ - public abstract Channel inheritedChannel() throws IOException; + 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 |