OSDN Git Service

libjava/classpath/ChangeLog.gcj:
[pf3gnuchains/gcc-fork.git] / libjava / classpath / java / nio / channels / spi / SelectorProvider.java
index db4e65f..b2fb7bb 100644 (file)
@@ -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.
    *