Return-Path: Delivered-To: apmail-hc-commits-archive@www.apache.org Received: (qmail 16971 invoked from network); 13 Jul 2009 18:11:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jul 2009 18:11:46 -0000 Received: (qmail 84326 invoked by uid 500); 13 Jul 2009 18:11:56 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 84293 invoked by uid 500); 13 Jul 2009 18:11:56 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 84277 invoked by uid 99); 13 Jul 2009 18:11:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jul 2009 18:11:53 +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, 13 Jul 2009 18:11:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3E4CA23888DB; Mon, 13 Jul 2009 18:11:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r793643 - in /httpcomponents/httpcore/trunk: httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ httpcore-nio/src/main/java/org/apache/http/nio/params/ httpcore/src/main/java/org... Date: Mon, 13 Jul 2009 18:11:27 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090713181128.3E4CA23888DB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Mon Jul 13 18:11:27 2009 New Revision: 793643 URL: http://svn.apache.org/viewvc?rev=793643&view=rev Log: Javadoc cleanups for 4.1-alpha1 release Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/BaseIOReactor.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorParams.java httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java Mon Jul 13 18:11:27 2009 @@ -203,7 +203,7 @@ protected HttpEntity prepareDecoder(final HttpMessage message) throws HttpException { BasicHttpEntity entity = new BasicHttpEntity(); long len = this.incomingContentStrategy.determineLength(message); - this.contentDecoder = createChunkDecoder( + this.contentDecoder = createContentDecoder( len, this.session.channel(), this.inbuf, @@ -233,8 +233,6 @@ /** * Factory method for {@link ContentDecoder} instances. * - * @since 4.1 - * * @param len content length, if known, {@link ContentLengthStrategy#CHUNKED} or * {@link ContentLengthStrategy#IDENTITY}, if unknown. * @param channel the session channel. @@ -242,8 +240,10 @@ * @param metrics transport metrics. * * @return content decoder. + * + * @since 4.1 */ - protected ContentDecoder createChunkDecoder( + protected ContentDecoder createContentDecoder( final long len, final ReadableByteChannel channel, final SessionInputBuffer buffer, @@ -276,8 +276,6 @@ /** * Factory method for {@link ContentEncoder} instances. * - * @since 4.1 - * * @param len content length, if known, {@link ContentLengthStrategy#CHUNKED} or * {@link ContentLengthStrategy#IDENTITY}, if unknown. * @param channel the session channel. @@ -285,6 +283,8 @@ * @param metrics transport metrics. * * @return content encoder. + * + * @since 4.1 */ protected ContentEncoder createContentEncoder( final long len, Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java Mon Jul 13 18:11:27 2009 @@ -89,6 +89,8 @@ * @param interestOpsQueueing Ops queueing flag. * * @throws IOReactorException in case if a non-recoverable I/O error. + * + * @since 4.1 */ public AbstractIOReactor(long selectTimeout, boolean interestOpsQueueing) throws IOReactorException { super(); @@ -203,6 +205,8 @@ /** * Returns true if interest Ops queueing is enabled, false otherwise. + * + * @since 4.1 */ public boolean getInterestOpsQueueing() { return this.interestOpsQueueing; @@ -359,7 +363,6 @@ } } - private void processNewChannels() throws IOReactorException { ChannelEntry entry; while ((entry = this.newChannels.poll()) != null) { @@ -442,10 +445,6 @@ } } - /** - Processes all pending {@link java.nio.channels.SelectionKey#interestOps(int) interestOps(int)} - operations. - */ private void processPendingInterestOps() { // validity check if (!this.interestOpsQueueing) { @@ -466,6 +465,31 @@ } } + /** + * Adds an {@link InterestOpEntry} to the interest ops queue for this instance. + * + * @return true if the operation could be performed successfully, + * false otherwise. + * + * @since 4.1 + */ + protected boolean queueInterestOps(final InterestOpEntry entry) { + // validity checks + if (!this.interestOpsQueueing) { + throw new IllegalStateException("Interest ops queueing not enabled"); + } + if (entry == null) { + return false; + } + + synchronized (this.interestOpsQueue) { + // add this operation to the interestOps() queue + this.interestOpsQueue.add(entry); + } + + return true; + } + /** * Closes out all I/O sessions maintained by this I/O reactor. */ @@ -586,27 +610,4 @@ shutdown(1000); } - /** - * Adds an {@link InterestOpEntry} to the interest ops queue for this instance. - * - * @return true if the operation could be performed successfully, - * false otherwise. - */ - protected boolean queueInterestOps(final InterestOpEntry entry) { - // validity checks - if (!this.interestOpsQueueing) { - throw new IllegalStateException("Interest ops queueing not enabled"); - } - if (entry == null) { - return false; - } - - synchronized (this.interestOpsQueue) { - // add this operation to the interestOps() queue - this.interestOpsQueue.add(entry); - } - - return true; - } - } Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/BaseIOReactor.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/BaseIOReactor.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/BaseIOReactor.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/BaseIOReactor.java Mon Jul 13 18:11:27 2009 @@ -80,8 +80,11 @@ * @param interestOpsQueueing Ops queueing flag. * * @throws IOReactorException in case if a non-recoverable I/O error. + * + * @since 4.1 */ - public BaseIOReactor(long selectTimeout, boolean interestOpsQueueing) throws IOReactorException { + public BaseIOReactor( + long selectTimeout, boolean interestOpsQueueing) throws IOReactorException { super(selectTimeout, interestOpsQueueing); this.bufferingSessions = new HashSet(); this.timeoutCheckInterval = selectTimeout; Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java Mon Jul 13 18:11:27 2009 @@ -63,6 +63,15 @@ private int socketTimeout; private volatile int currentEventMask; + /** + * Creates new instance of IOSessionImpl. + * + * @param key the selection key. + * @param interestOpsCallback interestOps callback. + * @param sessionClosedCallback session closed callback. + * + * @since 4.1 + */ public IOSessionImpl( final SelectionKey key, final InterestOpsCallback interestOpsCallback, @@ -81,6 +90,12 @@ this.status = ACTIVE; } + /** + * Creates new instance of IOSessionImpl. + * + * @param key the selection key. + * @param sessionClosedCallback session closed callback. + */ public IOSessionImpl( final SelectionKey key, final SessionClosedCallback sessionClosedCallback) { Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java Mon Jul 13 18:11:27 2009 @@ -36,6 +36,8 @@ /** * Helper class, representing an entry on an {@link java.nio.channels.SelectionKey#interestOps(int) * interestOps(int)} queue. + * + * @since 4.1 */ public class InterestOpEntry { Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java Mon Jul 13 18:11:27 2009 @@ -70,6 +70,8 @@ *

* This parameter expects a value of type {@link Boolean}. *

+ * + * @since 4.1 */ public static final String INTEREST_OPS_QUEUEING = "http.nio.interest-ops-queueing"; Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorParams.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorParams.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorParams.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/params/NIOReactorParams.java Mon Jul 13 18:11:27 2009 @@ -46,13 +46,26 @@ super(); } + /** + * Obtains the value of {@link NIOReactorPNames#CONTENT_BUFFER_SIZE} parameter. + * If not set, defaults to 4096. + * + * @param params HTTP parameters. + * @return content buffer size. + */ public static int getContentBufferSize(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } - return params.getIntParameter(CONTENT_BUFFER_SIZE, 1024); + return params.getIntParameter(CONTENT_BUFFER_SIZE, 4096); } + /** + * Sets value of the {@link NIOReactorPNames#CONTENT_BUFFER_SIZE} parameter. + * + * @param params HTTP parameters. + * @param size content buffer size. + */ public static void setContentBufferSize(final HttpParams params, int size) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -60,6 +73,13 @@ params.setIntParameter(CONTENT_BUFFER_SIZE, size); } + /** + * Obtains the value of {@link NIOReactorPNames#SELECT_INTERVAL} parameter. + * If not set, defaults to 1000. + * + * @param params HTTP parameters. + * @return I/O select interval in milliseconds. + */ public static long getSelectInterval(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -67,6 +87,12 @@ return params.getLongParameter(SELECT_INTERVAL, 1000); } + /** + * Sets value of the {@link NIOReactorPNames#SELECT_INTERVAL} parameter. + * + * @param params HTTP parameters. + * @param ms I/O select interval in milliseconds. + */ public static void setSelectInterval(final HttpParams params, long ms) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -74,6 +100,13 @@ params.setLongParameter(SELECT_INTERVAL, ms); } + /** + * Obtains the value of {@link NIOReactorPNames#GRACE_PERIOD} parameter. + * If not set, defaults to 500. + * + * @param params HTTP parameters. + * @return shutdown grace period in milliseconds. + */ public static long getGracePeriod(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -81,6 +114,12 @@ return params.getLongParameter(GRACE_PERIOD, 500); } + /** + * Sets value of the {@link NIOReactorPNames#GRACE_PERIOD} parameter. + * + * @param params HTTP parameters. + * @param ms shutdown grace period in milliseconds. + */ public static void setGracePeriod(final HttpParams params, long ms) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -88,6 +127,15 @@ params.setLongParameter(GRACE_PERIOD, ms); } + /** + * Obtains the value of {@link NIOReactorPNames#INTEREST_OPS_QUEUEING} parameter. + * If not set, defaults to false. + * + * @param params HTTP parameters. + * @return interest ops queuing flag. + * + * @since 4.1 + */ public static boolean getInterestOpsQueueing(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); @@ -95,7 +143,16 @@ return params.getBooleanParameter(INTEREST_OPS_QUEUEING, false); } - public static void setInterestOpsQueueing(final HttpParams params, boolean interestOpsQueueing) { + /** + * Sets value of the {@link NIOReactorPNames#INTEREST_OPS_QUEUEING} parameter. + * + * @param params HTTP parameters. + * @param interestOpsQueueing interest ops queuing. + * + * @since 4.1 + */ + public static void setInterestOpsQueueing( + final HttpParams params, boolean interestOpsQueueing) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java?rev=793643&r1=793642&r2=793643&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java (original) +++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java Mon Jul 13 18:11:27 2009 @@ -156,6 +156,8 @@ * * @throws IOException in case of an I/O error * @throws HttpException in case of HTTP protocol violation + * + * @since 4.1 */ public static Header[] parseHeaders( final SessionInputBuffer inbuffer,