You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/10/11 22:29:01 UTC

svn commit: r1397291 - in /tomcat/trunk/java/javax/servlet/http: HttpServletRequest.java HttpServletRequestWrapper.java ProtocolHandler.java WebConnection.java

Author: markt
Date: Thu Oct 11 20:29:01 2012
New Revision: 1397291

URL: http://svn.apache.org/viewvc?rev=1397291&view=rev
Log:
Fill in some of the HTTP upgrade Javadoc

Modified:
    tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
    tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
    tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java
    tomcat/trunk/java/javax/servlet/http/WebConnection.java

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=1397291&r1=1397290&r2=1397291&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Thu Oct 11 20:29:01 2012
@@ -485,8 +485,9 @@ public interface HttpServletRequest exte
             ServletException;
 
     /**
-     * TODO SERVLET 3.1
+     * Start the HTTP upgrade process and pass the connection to the provided
+     * protocol handler once the current request/response pair has completed
+     * processing.
      */
-    public abstract void upgrade(javax.servlet.http.ProtocolHandler handler)
-            throws java.io.IOException;
+    public void upgrade(ProtocolHandler handler) throws java.io.IOException;
 }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=1397291&r1=1397290&r2=1397291&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Thu Oct 11 20:29:01 2012
@@ -328,8 +328,7 @@ public class HttpServletRequestWrapper e
      * {@inheritDoc}
      */
     @Override
-    public void upgrade(javax.servlet.http.ProtocolHandler handler)
-            throws java.io.IOException {
+    public void upgrade(ProtocolHandler handler) throws java.io.IOException {
         this._getHttpServletRequest().upgrade(handler);
     }
 }

Modified: tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java?rev=1397291&r1=1397290&r2=1397291&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java (original)
+++ tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java Thu Oct 11 20:29:01 2012
@@ -15,10 +15,19 @@
  * limitations under the License.
  */
 package javax.servlet.http;
+
 /**
- * TODO SERVLET 3.1
- *
+ * Interface between the HTTP upgrade process and the new protocol.
  */
 public interface ProtocolHandler {
-    public abstract void init(javax.servlet.http.WebConnection connection);
+
+    /**
+     * This method is called once the request/response pair where
+     * {@link HttpServletRequest#upgrade(ProtocolHandler) is called has
+     * completed processing and is the point where control of the connection
+     * passes from the container to the {@link ProtocolHandler}.
+     *
+     * @param connection    The connection that has been upgraded
+     */
+    void init(WebConnection connection);
 }

Modified: tomcat/trunk/java/javax/servlet/http/WebConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/WebConnection.java?rev=1397291&r1=1397290&r2=1397291&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/WebConnection.java (original)
+++ tomcat/trunk/java/javax/servlet/http/WebConnection.java Thu Oct 11 20:29:01 2012
@@ -20,13 +20,22 @@ import java.io.IOException;
 
 import javax.servlet.ServletInputStream;
 import javax.servlet.ServletOutputStream;
+
 /**
- * TODO SERVLET 3.1
- *
+ * The interface used by a {@link ProtocolHandler} to interact with an upgraded
+ * HTTP connection.
  */
 public interface WebConnection {
-    public abstract ServletInputStream getInputStream()
-            throws IOException;
-    public abstract ServletOutputStream getOutputStream()
-            throws IOException;
+
+    /**
+     * Provides access to the {@link ServletInputStream} for reading data from
+     * the client.
+     */
+    ServletInputStream getInputStream() throws IOException;
+
+    /**
+     * Provides access to the {@link ServletOutputStream} for writing data to
+     * the client.
+     */
+    ServletOutputStream getOutputStream() throws IOException;
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1397291 - in /tomcat/trunk/java/javax/servlet/http: HttpServletRequest.java HttpServletRequestWrapper.java ProtocolHandler.java WebConnection.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/10/12 Mark Thomas <ma...@apache.org>:
> On 12/10/2012 08:54, Konstantin Kolinko wrote:
>> 2012/10/12  <ma...@apache.org>:
>>> Author: markt
>>> Date: Thu Oct 11 20:29:01 2012
>>> New Revision: 1397291
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1397291&view=rev
>>> Log:
>>> Fill in some of the HTTP upgrade Javadoc
>>>
>>> Modified:
>>>     tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
>>>     tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
>>>     tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java
>>>     tomcat/trunk/java/javax/servlet/http/WebConnection.java
>>>
>>
>>>
>>>      /**
>>> -     * TODO SERVLET 3.1
>>> +     * Start the HTTP upgrade process and pass the connection to the provided
>>> +     * protocol handler once the current request/response pair has completed
>>> +     * processing.
>>>       */
>>> -    public abstract void upgrade(javax.servlet.http.ProtocolHandler handler)
>>> -            throws java.io.IOException;
>>> +    public void upgrade(ProtocolHandler handler) throws java.io.IOException;
>>
>> It would be better to mark such new API as "@since Servlet 3.1"
>
> Agreed. I've done this and cleaned up / filled-in the Servlet 3.0 and
> Servlet 3.1 Javadoc for those classes. There is a fair amount of
> clean-up required in the Javadoc. I'm aiming to fix these as I touch the
> classes / have a spare 5 minutes to fill.
>

Looks good. Thank you.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1397291 - in /tomcat/trunk/java/javax/servlet/http: HttpServletRequest.java HttpServletRequestWrapper.java ProtocolHandler.java WebConnection.java

Posted by Mark Thomas <ma...@apache.org>.
On 12/10/2012 08:54, Konstantin Kolinko wrote:
> 2012/10/12  <ma...@apache.org>:
>> Author: markt
>> Date: Thu Oct 11 20:29:01 2012
>> New Revision: 1397291
>>
>> URL: http://svn.apache.org/viewvc?rev=1397291&view=rev
>> Log:
>> Fill in some of the HTTP upgrade Javadoc
>>
>> Modified:
>>     tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
>>     tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
>>     tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java
>>     tomcat/trunk/java/javax/servlet/http/WebConnection.java
>>
> 
>>
>>      /**
>> -     * TODO SERVLET 3.1
>> +     * Start the HTTP upgrade process and pass the connection to the provided
>> +     * protocol handler once the current request/response pair has completed
>> +     * processing.
>>       */
>> -    public abstract void upgrade(javax.servlet.http.ProtocolHandler handler)
>> -            throws java.io.IOException;
>> +    public void upgrade(ProtocolHandler handler) throws java.io.IOException;
> 
> It would be better to mark such new API as "@since Servlet 3.1"

Agreed. I've done this and cleaned up / filled-in the Servlet 3.0 and
Servlet 3.1 Javadoc for those classes. There is a fair amount of
clean-up required in the Javadoc. I'm aiming to fix these as I touch the
classes / have a spare 5 minutes to fill.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1397291 - in /tomcat/trunk/java/javax/servlet/http: HttpServletRequest.java HttpServletRequestWrapper.java ProtocolHandler.java WebConnection.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/10/12  <ma...@apache.org>:
> Author: markt
> Date: Thu Oct 11 20:29:01 2012
> New Revision: 1397291
>
> URL: http://svn.apache.org/viewvc?rev=1397291&view=rev
> Log:
> Fill in some of the HTTP upgrade Javadoc
>
> Modified:
>     tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
>     tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
>     tomcat/trunk/java/javax/servlet/http/ProtocolHandler.java
>     tomcat/trunk/java/javax/servlet/http/WebConnection.java
>

>
>      /**
> -     * TODO SERVLET 3.1
> +     * Start the HTTP upgrade process and pass the connection to the provided
> +     * protocol handler once the current request/response pair has completed
> +     * processing.
>       */
> -    public abstract void upgrade(javax.servlet.http.ProtocolHandler handler)
> -            throws java.io.IOException;
> +    public void upgrade(ProtocolHandler handler) throws java.io.IOException;

It would be better to mark such new API as "@since Servlet 3.1"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org