tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1354158 - in /tomcat/trunk/java: javax/servlet/ javax/servlet/http/ org/apache/catalina/connector/ org/apache/catalina/filters/ org/apache/catalina/ssi/ org/apache/jasper/tagplugins/jstl/
Date Tue, 26 Jun 2012 18:38:13 GMT
Author: fhanik
Date: Tue Jun 26 18:38:09 2012
New Revision: 1354158

URL: http://svn.apache.org/viewvc?rev=1354158&view=rev
Log:
Add in stub methods from servlet draft per 
http://java.net/projects/servlet-spec/lists/jsr340-experts/archive/2012-06/message/9
Note this may change at which point we will change it accordingly


Modified:
    tomcat/trunk/java/javax/servlet/ServletInputStream.java
    tomcat/trunk/java/javax/servlet/ServletOutputStream.java
    tomcat/trunk/java/javax/servlet/ServletRequest.java
    tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
    tomcat/trunk/java/javax/servlet/ServletResponse.java
    tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java
    tomcat/trunk/java/javax/servlet/http/HttpServlet.java
    tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
    tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteOutputStream.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
    tomcat/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java
    tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
    tomcat/trunk/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
    tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java

Modified: tomcat/trunk/java/javax/servlet/ServletInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletInputStream.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletInputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletInputStream.java Tue Jun 26 18:38:09 2012
@@ -81,4 +81,21 @@ public abstract class ServletInputStream
         }
         return count > 0 ? count : -1;
     }
+
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public abstract boolean isFinished();
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public abstract boolean isReady();
+
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public abstract void setReadListener(javax.servlet.ReadListener listener);
 }

Modified: tomcat/trunk/java/javax/servlet/ServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletOutputStream.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletOutputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletOutputStream.java Tue Jun 26 18:38:09 2012
@@ -271,4 +271,15 @@ public abstract class ServletOutputStrea
         print(d);
         println();
     }
-}
+
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public abstract boolean canWrite();
+
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public abstract void setWriteListener(javax.servlet.WriteListener listener);}

Modified: tomcat/trunk/java/javax/servlet/ServletRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequest.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRequest.java Tue Jun 26 18:38:09 2012
@@ -110,6 +110,12 @@ public interface ServletRequest {
     public int getContentLength();
 
     /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public long getContentLengthLong();
+
+    /**
      * Returns the MIME type of the body of the request, or <code>null</code>
if
      * the type is not known. For HTTP servlets, same as the value of the CGI
      * variable CONTENT_TYPE.

Modified: tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java Tue Jun 26 18:38:09 2012
@@ -113,6 +113,11 @@ public class ServletRequestWrapper imple
         return this.request.getContentLength();
     }
 
+    @Override
+    public long getContentLengthLong() {
+        return this.request.getContentLengthLong();
+    }
+
     /**
      * The default behavior of this method is to return getContentType() on the
      * wrapped request object.

Modified: tomcat/trunk/java/javax/servlet/ServletResponse.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletResponse.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletResponse.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletResponse.java Tue Jun 26 18:38:09 2012
@@ -175,6 +175,11 @@ public interface ServletResponse {
     public void setContentLength(int len);
 
     /**
+     * TODO SERVLET 3.1
+     */
+    public void setContentLengthLong(long length);
+
+    /**
      * Sets the content type of the response being sent to the client, if the
      * response has not been committed yet. The given content type may include a
      * character encoding specification, for example,

Modified: tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletResponseWrapper.java Tue Jun 26 18:38:09 2012
@@ -115,6 +115,14 @@ public class ServletResponseWrapper impl
     }
 
     /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setContentLengthLong(long length) {
+        this.response.setContentLengthLong(length);
+    }
+
+    /**
      * The default behavior of this method is to call setContentType(String
      * type) on the wrapped response object.
      */

Modified: tomcat/trunk/java/javax/servlet/http/HttpServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServlet.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServlet.java Tue Jun 26 18:38:09 2012
@@ -819,4 +819,22 @@ class NoBodyOutputStream extends Servlet
             throw new IOException(msg);
         }
     }
+
+    /**
+     * TODO SERVLET 3.1
+     * @return
+     */
+    public boolean canWrite() {
+        return false;
+    }
+
+    /**
+     * TODO SERVLET 3.1
+     * @param listener
+     */
+    public void setWriteListener(javax.servlet.WriteListener listener) {
+
+    }
+
+
 }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Tue Jun 26 18:38:09 2012
@@ -483,4 +483,10 @@ public interface HttpServletRequest exte
      */
     public Part getPart(String name) throws IOException,
             ServletException;
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    public abstract void upgrade(javax.servlet.http.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=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Tue Jun 26 18:38:09
2012
@@ -323,4 +323,13 @@ public class HttpServletRequestWrapper e
             ServletException {
         return this._getHttpServletRequest().getPart(name);
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void upgrade(javax.servlet.http.ProtocolHandler handler)
+            throws java.io.IOException {
+        this._getHttpServletRequest().upgrade(handler);
+    }
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java Tue Jun 26 18:38:09
2012
@@ -21,6 +21,7 @@ import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 
+import javax.servlet.ReadListener;
 import javax.servlet.ServletInputStream;
 
 import org.apache.catalina.security.SecurityUtil;
@@ -241,4 +242,35 @@ public class CoyoteInputStream
         }
     }
 
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public boolean isFinished() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public boolean isReady() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setReadListener(ReadListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+
+
+
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteOutputStream.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteOutputStream.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteOutputStream.java Tue Jun 26 18:38:09
2012
@@ -19,6 +19,7 @@ package org.apache.catalina.connector;
 import java.io.IOException;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 
 /**
  * Coyote implementation of the servlet output stream.
@@ -108,6 +109,25 @@ public class CoyoteOutputStream
         ob.close();
     }
 
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public boolean canWrite() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setWriteListener(WriteListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+
 
 }
 

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue Jun 26 18:38:09 2012
@@ -59,6 +59,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.Part;
+import javax.servlet.http.ProtocolHandler;
 
 import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
@@ -854,6 +855,7 @@ public class Request
     // ------------------------------------------------- ServletRequest Methods
 
 
+
     /**
      * Return the specified request attribute if it exists; otherwise, return
      * <code>null</code>.
@@ -909,6 +911,11 @@ public class Request
     }
 
 
+    @Override
+    public long getContentLengthLong() {
+        return coyoteRequest.getContentLengthLong();
+    }
+
     /**
      * Test if a given name is one of the special Servlet-spec SSL attributes.
      */
@@ -1837,6 +1844,14 @@ public class Request
 
     // --------------------------------------------- HttpServletRequest Methods
 
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void upgrade(ProtocolHandler handler) throws IOException {
+        // TODO Auto-generated method stub
+
+    }
 
     /**
      * Return the authentication type used for this Request.
@@ -1846,7 +1861,6 @@ public class Request
         return authType;
     }
 
-
     /**
      * Return the portion of the request URI used to select the Context
      * of the Request.

Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Tue Jun 26 18:38:09
2012
@@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.Part;
+import javax.servlet.http.ProtocolHandler;
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityUtil;
@@ -1102,4 +1103,22 @@ public class RequestFacade implements Ht
             throws IOException {
         request.doUpgrade(inbound);
     }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public long getContentLengthLong() {
+        return request.getContentLengthLong();
+    }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */    @Override
+    public void upgrade(ProtocolHandler handler) throws IOException {
+    }
+
+
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Tue Jun 26 18:38:09 2012
@@ -667,6 +667,16 @@ public class Response
     @Override
     public void setContentLength(int length) {
 
+        setContentLengthLong(length);
+    }
+
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setContentLengthLong(long length) {
         if (isCommitted()) {
             return;
         }

Modified: tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java Tue Jun 26 18:38:09
2012
@@ -232,6 +232,19 @@ public class ResponseFacade
     }
 
 
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setContentLengthLong(long length) {
+        if (isCommitted()) {
+            return;
+        }
+
+        response.setContentLengthLong(length);
+
+    }
+
     @Override
     public void setContentType(String type) {
 

Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Tue Jun 26 18:38:09 2012
@@ -36,6 +36,7 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
+import javax.servlet.WriteListener;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
@@ -992,6 +993,26 @@ public class ExpiresFilter extends Filte
             servletOutputStream.write(b);
         }
 
+        /**
+         * TODO SERVLET 3.1
+         */
+        @Override
+        public boolean canWrite() {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        /**
+         * TODO SERVLET 3.1
+         */
+        @Override
+        public void setWriteListener(WriteListener listener) {
+            // TODO Auto-generated method stub
+
+        }
+
+
+
     }
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java Tue Jun 26
18:38:09 2012
@@ -20,6 +20,7 @@ package org.apache.catalina.ssi;
 import java.io.ByteArrayOutputStream;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 
 
 /**
@@ -62,4 +63,25 @@ public class ByteArrayServletOutputStrea
     public void write(int b) {
         buf.write(b);
     }
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public boolean canWrite() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /**
+     * TODO SERVLET 3.1
+     */
+    @Override
+    public void setWriteListener(WriteListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+
+
 }

Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java?rev=1354158&r1=1354157&r2=1354158&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java Tue Jun 26 18:38:09 2012
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingExcept
 import java.util.Locale;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
@@ -261,6 +262,27 @@ public class Util {
             public void write(int b) throws IOException {
                 bos.write(b);
             }
+
+            /**
+             * TODO SERVLET 3.1
+             */
+            @Override
+            public boolean canWrite() {
+                // TODO Auto-generated method stub
+                return false;
+            }
+
+            /**
+             * TODO SERVLET 3.1
+             */
+            @Override
+            public void setWriteListener(WriteListener listener) {
+                // TODO Auto-generated method stub
+
+            }
+
+
+
         };
         private boolean isWriterUsed;
         private boolean isStreamUsed;



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


Mime
View raw message