Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 36084 invoked from network); 27 Apr 2009 19:55:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Apr 2009 19:55:07 -0000 Received: (qmail 65379 invoked by uid 500); 27 Apr 2009 19:55:06 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 65339 invoked by uid 500); 27 Apr 2009 19:55:06 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 65330 invoked by uid 99); 27 Apr 2009 19:55:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 19:55:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 19:55:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E572B2388A46; Mon, 27 Apr 2009 19:54:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r769135 - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java Date: Mon, 27 Apr 2009 19:54:45 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090427195445.E572B2388A46@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tellison Date: Mon Apr 27 19:54:45 2009 New Revision: 769135 URL: http://svn.apache.org/viewvc?rev=769135&view=rev Log: Additional patch for HARMONY-6178 (Javadocs for java.nio.*) Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java?rev=769135&r1=769134&r2=769135&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java (original) +++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelector.java Mon Apr 27 19:54:45 2009 @@ -25,13 +25,10 @@ import java.util.concurrent.atomic.AtomicBoolean; /** - * Abstract class for selectors. - *

- * This class realizes the interruption of selection by begin and - * end. It also holds the cancelled and the deletion of the key + * {@code AbstractSelector} is the base implementation class for selectors. + * It realizes the interruption of selection by {@code begin} and + * {@code end}. It also holds the cancellation and the deletion of the key * set. - *

- * */ public abstract class AbstractSelector extends Selector { private final AtomicBoolean isOpen = new AtomicBoolean(true); @@ -44,19 +41,22 @@ private Set cancelledKeysSet = new HashSet(); /** - * Constructor for this class. + * Constructs a new {@code AbstractSelector}. * * @param selectorProvider - * A instance of SelectorProvider + * the selector provider that creates this selector. */ protected AbstractSelector(SelectorProvider selectorProvider) { provider = selectorProvider; } /** - * Closes this channel. + * Closes this selector. This method does nothing if this selector is + * already closed. The actual closing must be implemented by subclasses in + * {@code implCloseSelector()}. * - * @see java.nio.channels.Selector#close() + * @throws IOException + * if an I/O error occurs. */ @Override public final void close() throws IOException { @@ -69,12 +69,15 @@ * Implements the closing of this channel. * * @throws IOException - * If some I/O exception occurs. + * if an I/O error occurs. */ protected abstract void implCloseSelector() throws IOException; /** - * @see java.nio.channels.Selector#isOpen() + * Indicates whether this selector is open. + * + * @return {@code true} if this selector is not closed, {@code false} + * otherwise. */ @Override public final boolean isOpen() { @@ -82,9 +85,9 @@ } /** - * Answers the SelectorProvider of this channel. + * Gets this selector's provider. * - * @see java.nio.channels.Selector#provider() + * @return the provider of this selector. */ @Override public final SelectorProvider provider() { @@ -92,39 +95,44 @@ } /** - * Answers the cancelled key set of this channel. + * Returns this channel's set of canceled selection keys. * - * @return The cancelled key set. + * @return the set of canceled selection keys. */ protected final Set cancelledKeys() { return cancelledKeysSet; } /** - * Registers a channel to this selector. + * Registers a channel with this selector. * * @param channel - * The channel to be registered. + * the channel to be registered. * @param operations - * The interest set. + * the {@link SelectionKey interest set} of {@code channel}. * @param attachment - * The attachment of the key. - * @return The key related with the channel and the selector. + * the attachment for the selection key. + * @return the key related to the channel and this selector. */ protected abstract SelectionKey register(AbstractSelectableChannel channel, int operations, Object attachment); /** - * Deletes the key from channel's key set. + * Deletes the key from the channel's key set. * * @param key - * The key. + * the key. */ protected final void deregister(AbstractSelectionKey key) { ((AbstractSelectableChannel) key.channel()).deregister(key); key.isValid = false; } + /** + * Indicates the beginning of a code section that includes an I/O operation + * that is potentially blocking. After this operation, the application + * should invoke the corresponding {@code end(boolean)} method. + */ protected final void begin() { // FIXME: be accommodate before VM actually provides // setInterruptAction method @@ -142,6 +150,10 @@ } } + /** + * Indicates the end of a code section that has been started with + * {@code begin()} and that includes a potentially blocking I/O operation. + */ protected final void end() { // FIXME: be accommodate before VM actually provides // setInterruptAction method