Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E453939D for ; Tue, 6 Dec 2011 07:50:10 +0000 (UTC) Received: (qmail 82245 invoked by uid 500); 6 Dec 2011 07:50:09 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 82156 invoked by uid 500); 6 Dec 2011 07:50:07 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 82149 invoked by uid 99); 6 Dec 2011 07:50:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 07:50:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 06 Dec 2011 07:50:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AF91223888FD for ; Tue, 6 Dec 2011 07:49:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1210810 - in /felix/trunk/httplite/src/main/java/org/apache/felix/httplite: server/Connection.java server/ThreadPool.java servlet/HttpServletResponseImpl.java servlet/ServletContextImpl.java servlet/ServletPrintWriter.java Date: Tue, 06 Dec 2011 07:49:43 -0000 To: commits@felix.apache.org From: kgilmer@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111206074943.AF91223888FD@eris.apache.org> Author: kgilmer Date: Tue Dec 6 07:49:43 2011 New Revision: 1210810 URL: http://svn.apache.org/viewvc?rev=1210810&view=rev Log: httplite: cleanup and correct javadoc comments. Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/ThreadPool.java felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/HttpServletResponseImpl.java felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletContextImpl.java felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletPrintWriter.java Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java?rev=1210810&r1=1210809&r2=1210810&view=diff ============================================================================== --- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java (original) +++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java Tue Dec 6 07:49:43 2011 @@ -43,7 +43,13 @@ import org.apache.felix.httplite.servlet **/ public class Connection { + /** + * Connection timeout + */ public static final int DEFAULT_CONNECTION_TIMEOUT = 10000; + /** + * Requests per request + */ public static final int DEFAULT_CONNECTION_REQUESTLIMIT = 50; private final Socket m_socket; @@ -70,11 +76,11 @@ public class Connection /** * Constructs a connection with the specified inactivity timeout and request limit. - * @param server The web server associated with the connection. * @param socket The client socket. * @param timeout The inactivity timeout of the connection in milliseconds. * @param requestLimit The maximum number of consecutive requests. * @param resolver resolves a request URI to a client or servlet registration via the HTTP Service. + * @param logger logger instance. * @throws java.io.IOException If any I/O error occurs. */ public Connection(final Socket socket, final int timeout, final int requestLimit, final ServiceRegistrationResolver resolver, final Logger logger) throws IOException @@ -169,7 +175,7 @@ public class Connection } m_requestCount++; - // Keep track of whether we have errored or not, + // Keep track of whether we have failed or not, // because we still want to read the bytes to clear // the input stream so we can service more requests. boolean error = false; @@ -207,8 +213,8 @@ public class Connection response.setConnectionType("close"); } - // We only service GET and/or HEAD requests, so send - // a "not implemented" error otherwise. + // We do not support OPTIONS method so send + // a "not implemented" error in that case. if (!HttpServletRequestImpl.isSupportedMethod(request.getMethod())) { error = true; @@ -216,7 +222,7 @@ public class Connection response.sendNotImplementedResponse(); } - // Ignore if we have already errored, otherwise send error message + // Ignore if we have already failed, otherwise send error message // if an HTTP/1.1 client did not include HOST header. if (!error && request.getProtocol().equals(HttpConstants.HTTP11_VERSION) && (request.getHeader(HttpConstants.HOST_HEADER) == null)) Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/ThreadPool.java URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/ThreadPool.java?rev=1210810&r1=1210809&r2=1210810&view=diff ============================================================================== --- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/ThreadPool.java (original) +++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/ThreadPool.java Tue Dec 6 07:49:43 2011 @@ -34,23 +34,27 @@ import org.apache.felix.httplite.osgi.Lo **/ public class ThreadPool { + /** + * Default thread timeout + */ public static final int DEFAULT_THREAD_TIMEOUT = 60000; - private int m_threadTimeout; + private final int m_threadTimeout; - private ThreadGroup m_group = new ThreadGroup("ThreadPoolGroup"); + private final ThreadGroup m_group = new ThreadGroup("ThreadPoolGroup"); private int m_state; private ThreadGate m_shutdownGate; private int m_threadName = 0; private int m_threadLimit = 0; private int m_threadCount = 0; private int m_threadAvailable = 0; - private List m_connectionList = new ArrayList(); + private final List m_connectionList = new ArrayList(); private final Logger m_logger; /** * Constructs a thread pool with the specified thread limit and with * the default inactivity timeout. * @param threadLimit The maximum number of threads in the pool. + * @param logger Logger instance. **/ public ThreadPool(final int threadLimit, final Logger logger) { @@ -62,6 +66,7 @@ public class ThreadPool * timeout. * @param threadLimit The maximum number of threads in the pool. * @param threadTimeout The inactivity timeout for threads in milliseconds. + * @param logger Logger instance. **/ public ThreadPool(int threadLimit, int threadTimeout, Logger logger) { Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/HttpServletResponseImpl.java URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/HttpServletResponseImpl.java?rev=1210810&r1=1210809&r2=1210810&view=diff ============================================================================== --- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/HttpServletResponseImpl.java (original) +++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/HttpServletResponseImpl.java Tue Dec 6 07:49:43 2011 @@ -68,8 +68,7 @@ public class HttpServletResponseImpl imp /** * Constructs an HTTP response for the specified server and request. - * @param server The web server associated with the response. - * @param request The HTTP request associated with the response. + * @param outputStream The output stream for the client. **/ public HttpServletResponseImpl(OutputStream outputStream) { @@ -652,6 +651,7 @@ public class HttpServletResponseImpl imp * Build a response given input parameters. * * @param code HTTP code + * @param headers Map of HTTP headers * @param userMessage user message * @param htmlStartTag custom HTML document start * @return byte array of response. Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletContextImpl.java URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletContextImpl.java?rev=1210810&r1=1210809&r2=1210810&view=diff ============================================================================== --- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletContextImpl.java (original) +++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletContextImpl.java Tue Dec 6 07:49:43 2011 @@ -292,6 +292,9 @@ public class ServletContextImpl implemen /* (non-Javadoc) * @see javax.servlet.ServletContext#getContextPath() */ + /** + * @return the context path. + */ public String getContextPath() { return m_name; } Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletPrintWriter.java URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletPrintWriter.java?rev=1210810&r1=1210809&r2=1210810&view=diff ============================================================================== --- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletPrintWriter.java (original) +++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/servlet/ServletPrintWriter.java Tue Dec 6 07:49:43 2011 @@ -34,7 +34,7 @@ public class ServletPrintWriter extends /** * @param outputStream OutputStream * @param characterEncoding character encoding - * @throws UnknownCharacterException if the character encoding is not supported. + * @throws CharConversionException if the character encoding is not supported. */ public ServletPrintWriter(OutputStream outputStream, String characterEncoding) throws CharConversionException {