diff options
Diffstat (limited to 'libjava/java/nio/channels')
-rw-r--r-- | libjava/java/nio/channels/SelectionKey.java | 2 | ||||
-rw-r--r-- | libjava/java/nio/channels/ServerSocketChannel.java | 17 | ||||
-rw-r--r-- | libjava/java/nio/channels/spi/AbstractSelectableChannel.java | 20 |
3 files changed, 28 insertions, 11 deletions
diff --git a/libjava/java/nio/channels/SelectionKey.java b/libjava/java/nio/channels/SelectionKey.java index 361be1895da..8d06a301143 100644 --- a/libjava/java/nio/channels/SelectionKey.java +++ b/libjava/java/nio/channels/SelectionKey.java @@ -147,8 +147,6 @@ public abstract class SelectionKey /** * Tells whether or not this key is valid. - * - * @exception CancelledKeyException If this key has been cancelled */ public abstract boolean isValid (); diff --git a/libjava/java/nio/channels/ServerSocketChannel.java b/libjava/java/nio/channels/ServerSocketChannel.java index ed8d39264df..16a3a82df5b 100644 --- a/libjava/java/nio/channels/ServerSocketChannel.java +++ b/libjava/java/nio/channels/ServerSocketChannel.java @@ -60,7 +60,18 @@ public abstract class ServerSocketChannel } /** - * Accepts a connection made to this channel's socket. + * Accepts a connection made to this channel's socket. + * + * @exception IOException If an error occurs + * @exception AsynchronousCloseException If another thread closes this + * channel while the accept operation is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the accept operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If the channel is closed. + * @exception NotYetBoundException If the channel's socket is not yet bound. + * @exception SecurityException If a security manager has been installed and + * it does not permit access to the remote endpoint of the new connection. */ public abstract SocketChannel accept (); @@ -70,7 +81,9 @@ public abstract class ServerSocketChannel public abstract ServerSocket socket (); /** - * Opens a server socker channel. + * Opens a server socket channel. + * + * @exception IOException If an error occurs */ public static ServerSocketChannel open () throws IOException { diff --git a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java index 433b7294902..da03693d2cc 100644 --- a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java +++ b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java @@ -78,8 +78,8 @@ public abstract class AbstractSelectableChannel extends SelectableChannel { synchronized (LOCK) { - blocking = true; - implConfigureBlocking (block); + blocking = true; + implConfigureBlocking (block); } return this; @@ -87,6 +87,8 @@ public abstract class AbstractSelectableChannel extends SelectableChannel /** * Closes this channel. + * + * @exception IOException If an error occurs */ protected final void implCloseChannel () { @@ -168,13 +170,17 @@ public abstract class AbstractSelectableChannel extends SelectableChannel private void add (SelectionKey key) { if (keys == null) - keys = new LinkedList (); + { + keys = new LinkedList (); + } keys.add (key); } /** * Registers this channel with the given selector, returning a selection key. + * + * @exception ClosedChannelException If the channel is already closed. */ public final SelectionKey register (Selector selin, int ops, Object att) throws ClosedChannelException @@ -187,19 +193,19 @@ public abstract class AbstractSelectableChannel extends SelectableChannel synchronized (LOCK) { - k = locate (selector); + k = locate (selector); - if (k != null) + if (k != null) { k.attach (att); } - else + else { k = selector.register (this, ops, att); if (k != null) add (k); - } + } } return k; |