summaryrefslogtreecommitdiffstats
path: root/libjava/java/nio/channels/Selector.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/nio/channels/Selector.java')
-rw-r--r--libjava/java/nio/channels/Selector.java75
1 files changed, 56 insertions, 19 deletions
diff --git a/libjava/java/nio/channels/Selector.java b/libjava/java/nio/channels/Selector.java
index 715bc7f98bb..a71280753d6 100644
--- a/libjava/java/nio/channels/Selector.java
+++ b/libjava/java/nio/channels/Selector.java
@@ -37,60 +37,97 @@ exception statement from your version. */
package java.nio.channels;
-import java.util.Set;
+import java.io.IOException;
import java.nio.channels.spi.SelectorProvider;
+import java.util.Set;
+/**
+ * @author Michael Koch
+ * @since 1.4
+ */
public abstract class Selector
{
+ /**
+ * Initializes the selector.
+ */
protected Selector()
{
}
/**
+ * Opens a selector.
+ *
* @exception IOException If an error occurs
*/
- public static Selector open()
+ public static Selector open ()
{
- return SelectorProvider.provider().openSelector();
+ return SelectorProvider.provider ().openSelector ();
}
/**
+ * Closes the selector.
+ *
* @exception IOException If an error occurs
*/
- public abstract void close();
-
- public abstract boolean isOpen();
+ public abstract void close () throws IOException;
/**
- * @exception ClosedSelectorException FIXME
+ * Tells whether the selector is open or not.
*/
- public abstract Set keys();
+ public abstract boolean isOpen ();
- public abstract SelectorProvider provider();
+ /**
+ * Returns this selector's key set.
+ *
+ * @exception ClosedSelectorException If this selector is closed.
+ */
+ public abstract Set keys ();
+
+ /**
+ * Returns the SelectorProvider that created the selector.
+ */
+ public abstract SelectorProvider provider ();
/**
- * @exception ClosedSelectorException FIXME
+ * Selects a set of keys whose corresponding channels are ready
+ * for I/O operations.
+ *
+ * @exception ClosedSelectorException If this selector is closed.
* @exception IOException If an error occurs
*/
- public abstract int select();
+ public abstract int select () throws IOException;
/**
- * @exception ClosedSelectorException FIXME
- * @exception IllegalArgumentException FIXME
+ * Selects a set of keys whose corresponding channels are ready
+ * for I/O operations.
+ *
+ * @param timeout The timeout to use.
+ *
+ * @exception ClosedSelectorException If this selector is closed.
+ * @exception IllegalArgumentException If the timeout value is negative.
* @exception IOException If an error occurs
*/
- public abstract int select(long timeout);
+ public abstract int select (long timeout) throws IOException;
/**
- * @exception ClosedSelectorException FIXME
+ * Returns this selector's selected-key set.
+ *
+ * @exception ClosedSelectorException If this selector is closed.
*/
- public abstract Set selectedKeys();
+ public abstract Set selectedKeys ();
/**
- * @exception ClosedSelectorException FIXME
+ * Selects a set of keys whose corresponding channels are ready
+ * for I/O operations.
+ *
+ * @exception ClosedSelectorException If this selector is closed.
* @exception IOException If an error occurs
*/
- public abstract int selectNow();
+ public abstract int selectNow () throws IOException;
- public abstract Selector wakeup();
+ /**
+ * Causes the first selection operation that has not yet returned to
+ * return immediately.
+ */
+ public abstract Selector wakeup ();
}
OpenPOWER on IntegriCloud