You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ro...@apache.org on 2007/09/16 14:30:35 UTC

svn commit: r576088 - in /jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio: params/HttpNIOParams.java params/NIOReactorPNames.java protocol/ThrottlingHttpClientHandler.java protocol/ThrottlingHttpServiceHandler.java

Author: rolandw
Date: Sun Sep 16 05:30:34 2007
New Revision: 576088

URL: http://svn.apache.org/viewvc?rev=576088&view=rev
Log:
parameter names in interfaces, part 5 - NIO

Added:
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java   (with props)
Modified:
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/HttpNIOParams.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/HttpNIOParams.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/HttpNIOParams.java?rev=576088&r1=576087&r2=576088&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/HttpNIOParams.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/HttpNIOParams.java Sun Sep 16 05:30:34 2007
@@ -42,27 +42,11 @@
  * @version $Revision$
  * 
  * @since 4.0
+ *
+ * @see NIOReactorPNames
  */
 public final class HttpNIOParams {
 
-    /**
-     * Determines the size of the content input / output buffers used to buffer data
-     * while receiving / transmitting HTTP messages.
-     * <p>
-     * This parameter expects a value of type {@link Integer}.
-     * </p>
-     */
-    public static final String CONTENT_BUFFER_SIZE = "http.nio.content-buffer-size"; 
-
-    /**
-     * Determines the time interval in milliseconds at which the I/O reactor wakes up 
-     * to check for timed out sessions and session requests.
-     * <p>
-     * This parameter expects a value of type {@link Long}.
-     * </p>
-     */
-    public static final String SELECT_INTERVAL = "http.nio.select-interval"; 
-
     private HttpNIOParams() {
         super();
     }
@@ -71,28 +55,32 @@
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        return params.getIntParameter(CONTENT_BUFFER_SIZE, 1024);
+        return params.getIntParameter
+            (NIOReactorPNames.CONTENT_BUFFER_SIZE, 1024);
     }
     
     public static void setContentBufferSize(final HttpParams params, int size) {
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        params.setIntParameter(CONTENT_BUFFER_SIZE, size);
+        params.setIntParameter
+            (NIOReactorPNames.CONTENT_BUFFER_SIZE, size);
     }
 
     public static long getSelectInterval(final HttpParams params) {
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        return params.getLongParameter(SELECT_INTERVAL, 1000);
+        return params.getLongParameter
+            (NIOReactorPNames.SELECT_INTERVAL, 1000);
     }
     
     public static void setSelectInterval(final HttpParams params, long ms) {
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        params.setLongParameter(SELECT_INTERVAL, ms);
+        params.setLongParameter
+            (NIOReactorPNames.SELECT_INTERVAL, ms);
     }
 
 }

Added: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java?rev=576088&view=auto
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java (added)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java Sun Sep 16 05:30:34 2007
@@ -0,0 +1,65 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.nio.params;
+
+
+/**
+ * Parameter names for reactors in HttpNIO.
+ * 
+ * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
+ * 
+ * @version $Revision$
+ * 
+ * @since 4.0
+ */
+public interface NIOReactorPNames {
+
+    /**
+     * Determines the size of the content input/output buffers used
+     * to buffer data while receiving or transmitting HTTP messages.
+     * <p>
+     * This parameter expects a value of type {@link Integer}.
+     * </p>
+     */
+    public static final String CONTENT_BUFFER_SIZE = "http.nio.content-buffer-size"; 
+
+    /**
+     * Determines the time interval in milliseconds at which the
+     * I/O reactor wakes up 
+     * to check for timed out sessions and session requests.
+     * <p>
+     * This parameter expects a value of type {@link Long}.
+     * </p>
+     */
+    public static final String SELECT_INTERVAL = "http.nio.select-interval"; 
+
+}

Propchange: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/params/NIOReactorPNames.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java?rev=576088&r1=576087&r2=576088&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java Sun Sep 16 05:30:34 2007
@@ -48,7 +48,7 @@
 import org.apache.http.nio.NHttpConnection;
 import org.apache.http.nio.entity.ContentBufferEntity;
 import org.apache.http.nio.entity.ContentOutputStream;
-import org.apache.http.nio.params.HttpNIOParams;
+import org.apache.http.nio.params.NIOReactorPNames;
 import org.apache.http.nio.protocol.ThrottlingHttpServiceHandler.ServerConnState;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.ContentInputBuffer;
@@ -76,7 +76,7 @@
  * which is expected to perform those tasks using dedicated worker threads in 
  * order to avoid blocking the I/O thread.</p>
  * 
- * @see HttpNIOParams#CONTENT_BUFFER_SIZE
+ * @see NIOReactorPNames#CONTENT_BUFFER_SIZE
  * 
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
@@ -115,7 +115,7 @@
         initialize(conn, attachment);
         
         int bufsize = this.params.getIntParameter(
-                HttpNIOParams.CONTENT_BUFFER_SIZE, 20480);
+                NIOReactorPNames.CONTENT_BUFFER_SIZE, 20480);
         ClientConnState connState = new ClientConnState(bufsize, conn, this.allocator); 
         context.setAttribute(CONN_STATE, connState);
 

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java?rev=576088&r1=576087&r2=576088&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java Sun Sep 16 05:30:34 2007
@@ -55,7 +55,7 @@
 import org.apache.http.nio.NHttpServerConnection;
 import org.apache.http.nio.entity.ContentBufferEntity;
 import org.apache.http.nio.entity.ContentOutputStream;
-import org.apache.http.nio.params.HttpNIOParams;
+import org.apache.http.nio.params.NIOReactorPNames;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.ContentInputBuffer;
 import org.apache.http.nio.util.ContentOutputBuffer;
@@ -83,7 +83,7 @@
  * perform those tasks using dedicated worker threads in order to avoid 
  * blocking the I/O thread.</p>
  * 
- * @see HttpNIOParams#CONTENT_BUFFER_SIZE
+ * @see NIOReactorPNames#CONTENT_BUFFER_SIZE
  * 
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
@@ -117,7 +117,7 @@
         HttpContext context = conn.getContext();
 
         int bufsize = this.params.getIntParameter(
-                HttpNIOParams.CONTENT_BUFFER_SIZE, 20480);
+                NIOReactorPNames.CONTENT_BUFFER_SIZE, 20480);
         ServerConnState connState = new ServerConnState(bufsize, conn, allocator); 
         context.setAttribute(CONN_STATE, connState);