geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r788194 [3/6] - in /geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet: ./ annotation/ annotation/jaxrs/ http/ http/annotation/
Date Wed, 24 Jun 2009 22:05:50 GMT
Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequest.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequest.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequest.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequest.java Wed Jun 24 22:05:48 2009
@@ -25,668 +25,495 @@
 import java.util.Locale;
 import java.util.Map;
 
-
-
 /**
  * Defines an object to provide client request information to a servlet.  The
  * servlet container creates a <code>ServletRequest</code> object and passes
  * it as an argument to the servlet's <code>service</code> method.
- *
+ * <p/>
  * <p>A <code>ServletRequest</code> object provides data including
  * parameter name and values, attributes, and an input stream.
  * Interfaces that extend <code>ServletRequest</code> can provide
  * additional protocol-specific data (for example, HTTP data is
  * provided by {@link javax.servlet.http.HttpServletRequest}.
- * 
- * @author 	Various
- * @version 	$Version$
- *
- * @see 	javax.servlet.http.HttpServletRequest
  *
+ * @see javax.servlet.http.HttpServletRequest
+ * @version $Rev$ $Date$
  */
 
 public interface ServletRequest {
 
     /**
-     *
+     * @param listener async listener to add
+     * @since Servlet 3.0
+     */
+    void addAsyncListener(AsyncListener listener);
+
+    /**
+     * @param listener async listener to add
+     * @param request  request for listener
+     * @param response response for listener
+     * @since Servlet 3.0
+     */
+    void addAsyncListener(AsyncListener listener, ServletRequest request, ServletResponse response);
+
+    /**
+     * @return async context
+     * @since Servlet 3.0
+     */
+    AsyncContext getAsyncContext();
+
+    /**
+     * @since Servlet 3.0
+     * @return async timeout in milliseconds
+     */
+    long getAsyncTimeout();
+
+    /**
      * Returns the value of the named attribute as an <code>Object</code>,
-     * or <code>null</code> if no attribute of the given name exists. 
-     *
+     * or <code>null</code> if no attribute of the given name exists.
+     * <p/>
      * <p> Attributes can be set two ways.  The servlet container may set
      * attributes to make available custom information about a request.
      * For example, for requests made using HTTPS, the attribute
      * <code>javax.servlet.request.X509Certificate</code> can be used to
      * retrieve information on the certificate of the client.  Attributes
-     * can also be set programatically using 
+     * can also be set programatically using
      * {@link ServletRequest#setAttribute}.  This allows information to be
      * embedded into a request before a {@link RequestDispatcher} call.
-     *
+     * <p/>
      * <p>Attribute names should follow the same conventions as package
      * names. This specification reserves names matching <code>java.*</code>,
-     * <code>javax.*</code>, and <code>sun.*</code>. 
-     *
-     * @param name	a <code>String</code> specifying the name of 
-     *			the attribute
-     *
-     * @return		an <code>Object</code> containing the value 
-     *			of the attribute, or <code>null</code> if
-     *			the attribute does not exist
+     * <code>javax.*</code>, and <code>sun.*</code>.
      *
+     * @param name a <code>String</code> specifying the name of
+     *             the attribute
+     * @return an <code>Object</code> containing the value
+     *         of the attribute, or <code>null</code> if
+     *         the attribute does not exist
      */
-
-    public Object getAttribute(String name);
-    
-    
+    Object getAttribute(String name);
 
     /**
      * Returns an <code>Enumeration</code> containing the
-     * names of the attributes available to this request. 
+     * names of the attributes available to this request.
      * This method returns an empty <code>Enumeration</code>
      * if the request has no attributes available to it.
-     * 
-     *
-     * @return		an <code>Enumeration</code> of strings 
-     *			containing the names 
-     * 			of the request's attributes
      *
+     * @return an <code>Enumeration</code> of strings
+     *         containing the names
+     *         of the request's attributes
      */
+    Enumeration<String> getAttributeNames();
 
-    public Enumeration getAttributeNames();
-    
-    
-    
-    
     /**
      * Returns the name of the character encoding used in the body of this
      * request. This method returns <code>null</code> if the request
      * does not specify a character encoding
-     * 
-     *
-     * @return		a <code>String</code> containing the name of 
-     *			the character encoding, or <code>null</code>
-     *			if the request does not specify a character encoding
      *
+     * @return a <code>String</code> containing the name of
+     *         the character encoding, or <code>null</code>
+     *         if the request does not specify a character encoding
      */
+    String getCharacterEncoding();
 
-    public String getCharacterEncoding();
-
- /**
-     * Overrides the name of the character encoding used in the body of this
-     * request. This method must be called prior to reading request parameters
-     * or reading input using getReader().
-     * 
-     *
-     * @param env	a <code>String</code> containing the name of 
-     *			the character encoding.
-     * @throws		java.io.UnsupportedEncodingException if this is not a valid encoding
-     */
-
-    public void setCharacterEncoding(String env) throws java.io.UnsupportedEncodingException;
-
-    
-    
-    
-    
     /**
-     * Returns the length, in bytes, of the request body 
+     * Returns the length, in bytes, of the request body
      * and made available by the input stream, or -1 if the
      * length is not known. For HTTP servlets, same as the value
      * of the CGI variable CONTENT_LENGTH.
      *
-     * @return		an integer containing the length of the 
-     * 			request body or -1 if the length is not known
-     *
+     * @return an integer containing the length of the
+     *         request body or -1 if the length is not known
      */
-
-    public int getContentLength();
-    
-    
-    
+    int getContentLength();
 
     /**
-     * Returns the MIME type of the body of the request, or 
-     * <code>null</code> if the type is not known. For HTTP servlets, 
+     * 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.
      *
-     * @return		a <code>String</code> containing the name 
-     *			of the MIME type of 
-     * 			the request, or null if the type is not known
-     *
+     * @return a <code>String</code> containing the name
+     *         of the MIME type of
+     *         the request, or null if the type is not known
      */
+    String getContentType();
 
-    public String getContentType();
-    
-    
-    
+    /**
+     * @since Servlet 3.0
+     * @return dispatcher type
+     */
+    DispatcherType getDispatcherType();
 
     /**
      * Retrieves the body of the request as binary data using
-     * a {@link ServletInputStream}.  Either this method or 
+     * a {@link ServletInputStream}.  Either this method or
      * {@link #getReader} may be called to read the body, not both.
      *
-     * @return			a {@link ServletInputStream} object containing
-     * 				the body of the request
+     * @return a {@link ServletInputStream} object containing
+     *         the body of the request
+     * @throws IllegalStateException if the {@link #getReader} method
+     *                               has already been called for this request
+     * @throws IOException           if an input or output exception occurred
+     */
+    ServletInputStream getInputStream() throws IOException;
+
+    /**
+     * Returns the Internet Protocol (IP) address of the interface on
+     * which the request  was received.
      *
-     * @exception IllegalStateException  if the {@link #getReader} method
-     * 					 has already been called for this request
+     * @return a <code>String</code> containing the
+     *         IP address on which the request was received.
+     * @since 2.4
+     */
+    String getLocalAddr();
+
+    /**
+     * Returns the preferred <code>Locale</code> that the client will
+     * accept content in, based on the Accept-Language header.
+     * If the client request doesn't provide an Accept-Language header,
+     * this method returns the default locale for the server.
      *
-     * @exception IOException    	if an input or output exception occurred
+     * @return the preferred <code>Locale</code> for the client
+     */
+    Locale getLocale();
+
+    /**
+     * Returns an <code>Enumeration</code> of <code>Locale</code> objects
+     * indicating, in decreasing order starting with the preferred locale, the
+     * locales that are acceptable to the client based on the Accept-Language
+     * header.
+     * If the client request doesn't provide an Accept-Language header,
+     * this method returns an <code>Enumeration</code> containing one
+     * <code>Locale</code>, the default locale for the server.
      *
+     * @return an <code>Enumeration</code> of preferred
+     *         <code>Locale</code> objects for the client
      */
+    Enumeration<Locale> getLocales();
 
-    public ServletInputStream getInputStream() throws IOException; 
-     
-    
-    
+    /**
+     * Returns the host name of the Internet Protocol (IP) interface on
+     * which the request was received.
+     *
+     * @return a <code>String</code> containing the host
+     *         name of the IP on which the request was received.
+     * @since 2.4
+     */
+    String getLocalName();
 
     /**
+     * Returns the Internet Protocol (IP) port number of the interface
+     * on which the request was received.
+     *
+     * @return an integer specifying the port number
+     * @since 2.4
+     */
+    int getLocalPort();
+
+     /**
      * Returns the value of a request parameter as a <code>String</code>,
      * or <code>null</code> if the parameter does not exist. Request parameters
      * are extra information sent with the request.  For HTTP servlets,
      * parameters are contained in the query string or posted form data.
-     *
+     * <p/>
      * <p>You should only use this method when you are sure the
      * parameter has only one value. If the parameter might have
      * more than one value, use {@link #getParameterValues}.
-     *
+     * <p/>
      * <p>If you use this method with a multivalued
      * parameter, the value returned is equal to the first value
      * in the array returned by <code>getParameterValues</code>.
-     *
+     * <p/>
      * <p>If the parameter data was sent in the request body, such as occurs
      * with an HTTP POST request, then reading the body directly via {@link
      * #getInputStream} or {@link #getReader} can interfere
      * with the execution of this method.
      *
-     * @param name 	a <code>String</code> specifying the 
-     *			name of the parameter
-     *
-     * @return		a <code>String</code> representing the 
-     *			single value of the parameter
-     *
-     * @see 		#getParameterValues
-     *
+     * @param name a <code>String</code> specifying the
+     *             name of the parameter
+     * @return a <code>String</code> representing the
+     *         single value of the parameter
+     * @see #getParameterValues
      */
-
-    public String getParameter(String name);
-    
-    
-    
+    String getParameter(String name);
 
     /**
+     * Returns a java.util.Map of the parameters of this request.
+     * Request parameters
+     * are extra information sent with the request.  For HTTP servlets,
+     * parameters are contained in the query string or posted form data.
      *
+     * @return an immutable java.util.Map containing parameter names as
+     *         keys and parameter values as map values. The keys in the parameter
+     *         map are of type String. The values in the parameter map are of type
+     *         String array.
+     */
+    Map<String, String[]> getParameterMap();
+
+    /**
      * Returns an <code>Enumeration</code> of <code>String</code>
      * objects containing the names of the parameters contained
-     * in this request. If the request has 
-     * no parameters, the method returns an 
-     * empty <code>Enumeration</code>. 
-     *
-     * @return		an <code>Enumeration</code> of <code>String</code>
-     *			objects, each <code>String</code> containing
-     * 			the name of a request parameter; or an 
-     *			empty <code>Enumeration</code> if the
-     *			request has no parameters
+     * in this request. If the request has
+     * no parameters, the method returns an
+     * empty <code>Enumeration</code>.
      *
+     * @return an <code>Enumeration</code> of <code>String</code>
+     *         objects, each <code>String</code> containing
+     *         the name of a request parameter; or an
+     *         empty <code>Enumeration</code> if the
+     *         request has no parameters
      */
-     
-    public Enumeration getParameterNames();
-    
-    
-    
+    Enumeration<String> getParameterNames();
 
     /**
-     * Returns an array of <code>String</code> objects containing 
-     * all of the values the given request parameter has, or 
+     * Returns an array of <code>String</code> objects containing
+     * all of the values the given request parameter has, or
      * <code>null</code> if the parameter does not exist.
-     *
+     * <p/>
      * <p>If the parameter has a single value, the array has a length
      * of 1.
      *
-     * @param name	a <code>String</code> containing the name of 
-     *			the parameter whose value is requested
-     *
-     * @return		an array of <code>String</code> objects 
-     *			containing the parameter's values
-     *
-     * @see		#getParameter
-     *
+     * @param name a <code>String</code> containing the name of
+     *             the parameter whose value is requested
+     * @return an array of <code>String</code> objects
+     *         containing the parameter's values
+     * @see #getParameter
      */
 
-    public String[] getParameterValues(String name);
- 
-    /** Returns a java.util.Map of the parameters of this request.
-     * Request parameters
-     * are extra information sent with the request.  For HTTP servlets,
-     * parameters are contained in the query string or posted form data.
-     *
-     * @return an immutable java.util.Map containing parameter names as 
-     * keys and parameter values as map values. The keys in the parameter
-     * map are of type String. The values in the parameter map are of type
-     * String array.
-     *
-     */
-
-    public Map getParameterMap();
-    
-    
+    String[] getParameterValues(String name);
 
     /**
      * Returns the name and version of the protocol the request uses
-     * in the form <i>protocol/majorVersion.minorVersion</i>, for 
+     * in the form <i>protocol/majorVersion.minorVersion</i>, for
      * example, HTTP/1.1. For HTTP servlets, the value
-     * returned is the same as the value of the CGI variable 
+     * returned is the same as the value of the CGI variable
      * <code>SERVER_PROTOCOL</code>.
      *
-     * @return		a <code>String</code> containing the protocol 
-     *			name and version number
-     *
+     * @return a <code>String</code> containing the protocol
+     *         name and version number
      */
-    
-    public String getProtocol();
-    
-    
-    
+    String getProtocol();
 
     /**
-     * Returns the name of the scheme used to make this request, 
-     * for example,
-     * <code>http</code>, <code>https</code>, or <code>ftp</code>.
-     * Different schemes have different rules for constructing URLs,
-     * as noted in RFC 1738.
-     *
-     * @return		a <code>String</code> containing the name 
-     *			of the scheme used to make this request
-     *
-     */
-
-    public String getScheme();
-    
-    
-    
-
-    /**
-     * Returns the host name of the server to which the request was sent.
-     * It is the value of the part before ":" in the <code>Host</code>
-     * header value, if any, or the resolved server name, or the server IP address.
-     *
-     * @return		a <code>String</code> containing the name 
-     *			of the server
-     */
-
-    public String getServerName();
-    
-    
-    
-
-    /**
-     * Returns the port number to which the request was sent.
-     * It is the value of the part after ":" in the <code>Host</code>
-     * header value, if any, or the server port where the client connection
-     * was accepted on.
-     *
-     * @return		an integer specifying the port number
-     *
-     */
-
-    public int getServerPort();
-    
-    
-    
-    /**
      * Retrieves the body of the request as character data using
      * a <code>BufferedReader</code>.  The reader translates the character
      * data according to the character encoding used on the body.
      * Either this method or {@link #getInputStream} may be called to read the
      * body, not both.
-     * 
-     *
-     * @return					a <code>BufferedReader</code>
-     *						containing the body of the request	
-     *
-     * @exception java.io.UnsupportedEncodingException         if the character set encoding
-     * 						used is not supported and the 
-     *						text cannot be decoded
-     *
-     * @exception IllegalStateException   	if {@link #getInputStream} method
-     * 						has been called on this request
-     *
-     * @exception IOException  			if an input or output exception occurred
-     *
-     * @see 					#getInputStream
      *
+     * @return a <code>BufferedReader</code>
+     *         containing the body of the request
+     * @throws java.io.UnsupportedEncodingException
+     *                               if the character set encoding
+     *                               used is not supported and the
+     *                               text cannot be decoded
+     * @throws IllegalStateException if {@link #getInputStream} method
+     *                               has been called on this request
+     * @throws IOException           if an input or output exception occurred
+     * @see #getInputStream
      */
+    BufferedReader getReader() throws IOException;
 
-    public BufferedReader getReader() throws IOException;
-    
-    
-    
+    /**
+     * @deprecated As of Version 2.1 of the Java Servlet API,
+     *             use {@link ServletContext#getRealPath} instead.
+     */
+    String getRealPath(String path);
 
     /**
-     * Returns the Internet Protocol (IP) address of the client 
+     * Returns the Internet Protocol (IP) address of the client
      * or last proxy that sent the request.
-     * For HTTP servlets, same as the value of the 
+     * For HTTP servlets, same as the value of the
      * CGI variable <code>REMOTE_ADDR</code>.
      *
-     * @return		a <code>String</code> containing the 
-     *			IP address of the client that sent the request
-     *
+     * @return a <code>String</code> containing the
+     *         IP address of the client that sent the request
      */
-    
-    public String getRemoteAddr();
-    
-    
-    
+    String getRemoteAddr();
 
     /**
      * Returns the fully qualified name of the client
      * or the last proxy that sent the request.
-     * If the engine cannot or chooses not to resolve the hostname 
-     * (to improve performance), this method returns the dotted-string form of 
-     * the IP address. For HTTP servlets, same as the value of the CGI variable 
+     * If the engine cannot or chooses not to resolve the hostname
+     * (to improve performance), this method returns the dotted-string form of
+     * the IP address. For HTTP servlets, same as the value of the CGI variable
      * <code>REMOTE_HOST</code>.
      *
-     * @return		a <code>String</code> containing the fully 
-     *			qualified name of the client
-     *
+     * @return a <code>String</code> containing the fully
+     *         qualified name of the client
      */
+    String getRemoteHost();
 
-    public String getRemoteHost();
-    
-    
-    
+     /**
+      * Returns the Internet Protocol (IP) source port of the client
+      * or last proxy that sent the request.
+      *
+      * @return an integer specifying the port number
+      * @since 2.4
+      */
+     int getRemotePort();
 
     /**
+     * Returns a {@link RequestDispatcher} object that acts as a wrapper for
+     * the resource located at the given path.
+     * A <code>RequestDispatcher</code> object can be used to forward
+     * a request to the resource or to include the resource in a response.
+     * The resource can be dynamic or static.
+     * <p/>
+     * <p>The pathname specified may be relative, although it cannot extend
+     * outside the current servlet context.  If the path begins with
+     * a "/" it is interpreted as relative to the current context root.
+     * This method returns <code>null</code> if the servlet container
+     * cannot return a <code>RequestDispatcher</code>.
+     * <p/>
+     * <p>The difference between this method and {@link
+     * ServletContext#getRequestDispatcher} is that this method can take a
+     * relative path.
      *
-     * Stores an attribute in this request.
-     * Attributes are reset between requests.  This method is most
-     * often used in conjunction with {@link RequestDispatcher}.
-     *
-     * <p>Attribute names should follow the same conventions as
-     * package names. Names beginning with <code>java.*</code>,
-     * <code>javax.*</code>, and <code>com.sun.*</code>, are
-     * reserved for use by Sun Microsystems.
-     *<br> If the object passed in is null, the effect is the same as
-     * calling {@link #removeAttribute}.
-     * <br> It is warned that when the request is dispatched from the
-     * servlet resides in a different web application by
-     * <code>RequestDispatcher</code>, the object set by this method
-     * may not be correctly retrieved in the caller servlet.
-     *
-     *
-     * @param name			a <code>String</code> specifying 
-     *					the name of the attribute
-     *
-     * @param o				the <code>Object</code> to be stored
-     *
+     * @param path a <code>String</code> specifying the pathname
+     *             to the resource. If it is relative, it must be
+     *             relative against the current servlet.
+     * @return a <code>RequestDispatcher</code> object
+     *         that acts as a wrapper for the resource
+     *         at the specified path, or <code>null</code>
+     *         if the servlet container cannot return a
+     *         <code>RequestDispatcher</code>
+     * @see RequestDispatcher
+     * @see ServletContext#getRequestDispatcher
      */
-
-    public void setAttribute(String name, Object o);
-    
-    
-    
+    RequestDispatcher getRequestDispatcher(String path);
 
     /**
+     * Returns the name of the scheme used to make this request,
+     * for example,
+     * <code>http</code>, <code>https</code>, or <code>ftp</code>.
+     * Different schemes have different rules for constructing URLs,
+     * as noted in RFC 1738.
      *
-     * Removes an attribute from this request.  This method is not
-     * generally needed as attributes only persist as long as the request
-     * is being handled.
-     *
-     * <p>Attribute names should follow the same conventions as
-     * package names. Names beginning with <code>java.*</code>,
-     * <code>javax.*</code>, and <code>com.sun.*</code>, are
-     * reserved for use by Sun Microsystems.
-     *
-     *
-     * @param name			a <code>String</code> specifying 
-     *					the name of the attribute to remove
-     *
+     * @return a <code>String</code> containing the name
+     *         of the scheme used to make this request
      */
-
-    public void removeAttribute(String name);
-    
-    
-    
+    String getScheme();
 
     /**
+     * Returns the host name of the server to which the request was sent.
+     * It is the value of the part before ":" in the <code>Host</code>
+     * header value, if any, or the resolved server name, or the server IP address.
      *
-     * Returns the preferred <code>Locale</code> that the client will 
-     * accept content in, based on the Accept-Language header.
-     * If the client request doesn't provide an Accept-Language header,
-     * this method returns the default locale for the server.
-     *
-     *
-     * @return		the preferred <code>Locale</code> for the client
-     *
+     * @return a <code>String</code> containing the name
+     *         of the server
      */
-
-    public Locale getLocale();
-    
-    
-    
+    String getServerName();
 
     /**
+     * Returns the port number to which the request was sent.
+     * It is the value of the part after ":" in the <code>Host</code>
+     * header value, if any, or the server port where the client connection
+     * was accepted on.
      *
-     * Returns an <code>Enumeration</code> of <code>Locale</code> objects
-     * indicating, in decreasing order starting with the preferred locale, the
-     * locales that are acceptable to the client based on the Accept-Language
-     * header.
-     * If the client request doesn't provide an Accept-Language header,
-     * this method returns an <code>Enumeration</code> containing one 
-     * <code>Locale</code>, the default locale for the server.
-     *
-     *
-     * @return		an <code>Enumeration</code> of preferred 
-     *                  <code>Locale</code> objects for the client
-     *
+     * @return an integer specifying the port number
      */
+    int getServerPort();
 
-    public Enumeration getLocales();
-    
-    
-    
+    /**
+      * Get the servlet context the request-response pair was last dispatched through.
+      *
+      * @return the latest ServletContext on the dispatch chain.
+      * @since 3.0
+      */
+     ServletContext getServletContext();
 
     /**
-     *
-     * Returns a boolean indicating whether this request was made using a
-     * secure channel, such as HTTPS.
-     *
-     *
-     * @return		a boolean indicating if the request was made using a
-     *                  secure channel
-     *
+     * @since Servlet 3.0
+     * @return if async is started
      */
-
-    public boolean isSecure();
-    
-    
-    
+    boolean isAsyncStarted();
 
     /**
-     *
-     * Returns a {@link RequestDispatcher} object that acts as a wrapper for
-     * the resource located at the given path.  
-     * A <code>RequestDispatcher</code> object can be used to forward
-     * a request to the resource or to include the resource in a response.
-     * The resource can be dynamic or static.
-     *
-     * <p>The pathname specified may be relative, although it cannot extend
-     * outside the current servlet context.  If the path begins with 
-     * a "/" it is interpreted as relative to the current context root.  
-     * This method returns <code>null</code> if the servlet container
-     * cannot return a <code>RequestDispatcher</code>.
-     *
-     * <p>The difference between this method and {@link
-     * ServletContext#getRequestDispatcher} is that this method can take a
-     * relative path.
-     *
-     * @param path      a <code>String</code> specifying the pathname
-     *                  to the resource. If it is relative, it must be
-     *                  relative against the current servlet.
-     *
-     * @return          a <code>RequestDispatcher</code> object
-     *                  that acts as a wrapper for the resource
-     *                  at the specified path, or <code>null</code>
-     *                  if the servlet container cannot return a
-     *                  <code>RequestDispatcher</code>
-     *
-     * @see             RequestDispatcher
-     * @see             ServletContext#getRequestDispatcher
-     *
+     * @since Servlet 3.0
+     * @return if async is supported
      */
-
-    public RequestDispatcher getRequestDispatcher(String path);
-    
-    
-    
+    boolean isAsyncSupported();
 
     /**
-     * 
-     * @deprecated 	As of Version 2.1 of the Java Servlet API,
-     * 			use {@link ServletContext#getRealPath} instead.
+     * Returns a boolean indicating whether this request was made using a
+     * secure channel, such as HTTPS.
      *
+     * @return a boolean indicating if the request was made using a
+     *         secure channel
      */
+    boolean isSecure();
 
-    public String getRealPath(String path);
-    
-    
     /**
-     * Returns the Internet Protocol (IP) source port of the client
-     * or last proxy that sent the request.
-     *
-     * @return	an integer specifying the port number
+     * Removes an attribute from this request.  This method is not
+     * generally needed as attributes only persist as long as the request
+     * is being handled.
+     * <p/>
+     * <p>Attribute names should follow the same conventions as
+     * package names. Names beginning with <code>java.*</code>,
+     * <code>javax.*</code>, and <code>com.sun.*</code>, are
+     * reserved for use by Sun Microsystems.
      *
-     * @since 2.4
-     */    
-    public int getRemotePort();
-
+     * @param name a <code>String</code> specifying
+     *             the name of the attribute to remove
+     */
+    void removeAttribute(String name);
 
     /**
-     * Returns the host name of the Internet Protocol (IP) interface on
-     * which the request was received.
-     *
-     * @return	a <code>String</code> containing the host
-     *		name of the IP on which the request was received.
-     *
-     * @since 2.4
+     * @param timeout timeout in milliseconds
+     * @since Servlet 3.0
      */
-    public String getLocalName();
+    void setAsyncTimeout(long timeout);
 
     /**
-     * Returns the Internet Protocol (IP) address of the interface on
-     * which the request  was received.
-     *
-     * @return	a <code>String</code> containing the
-     *		IP address on which the request was received. 
-     *
-     * @since 2.4
+     * Stores an attribute in this request.
+     * Attributes are reset between requests.  This method is most
+     * often used in conjunction with {@link RequestDispatcher}.
+     * <p/>
+     * <p>Attribute names should follow the same conventions as
+     * package names. Names beginning with <code>java.*</code>,
+     * <code>javax.*</code>, and <code>com.sun.*</code>, are
+     * reserved for use by Sun Microsystems.
+     * <br> If the object passed in is null, the effect is the same as
+     * calling {@link #removeAttribute}.
+     * <br> It is warned that when the request is dispatched from the
+     * servlet resides in a different web application by
+     * <code>RequestDispatcher</code>, the object set by this method
+     * may not be correctly retrieved in the caller servlet.
      *
-     */       
-    public String getLocalAddr();
-
-
+     * @param name a <code>String</code> specifying
+     *             the name of the attribute
+     * @param o    the <code>Object</code> to be stored
+     */
+    void setAttribute(String name, Object o);
+    
     /**
-     * Returns the Internet Protocol (IP) port number of the interface
-     * on which the request was received.
-     *
-     * @return an integer specifying the port number
+     * Overrides the name of the character encoding used in the body of this
+     * request. This method must be called prior to reading request parameters
+     * or reading input using getReader().
      *
-     * @since 2.4
+     * @param env a <code>String</code> containing the name of
+     *            the character encoding.
+     * @throws java.io.UnsupportedEncodingException
+     *          if this is not a valid encoding
      */
-    public int getLocalPort();
+    void setCharacterEncoding(String env) throws java.io.UnsupportedEncodingException;
 
     /**
-     * Get the servlet context the request-response pair was last dispatched through.
-     * @return the latest ServletContext on the dispatch chain.
+     *
+     * @return AsyncContext to control further work
      * @since 3.0
      */
-    ServletContext getServletContext();
+    AsyncContext startAsync();
 
     /**
-     * Gets the associated servlet response.
-     * @return the ServletResponse associated with this request.
+     *
+     * @param request servlet request
+     * @param response servlet response
+     * @return AsyncContext to control further work
      * @since 3.0
      */
-    ServletResponse getServletResponse();
-
-    void addAsyncListener(AsyncListener listener);
-    
-    void addAsyncListener(AsyncListener listener, ServletRequest request, ServletResponse response);
-
-    AsyncContext getAsyncContext();
-
-    boolean isAsyncStarted();
-
-    boolean isAsyncSupported();
-
-    void setAsyncTimeout(long timeout);
-
-    AsyncContext startAsync();
-
     AsyncContext startAsync(ServletRequest request, ServletResponse response);
 
-    DispatcherType getDispatcherType();
-
-
-//    /**
-//      * complete a suspended request.
-//      * @throws IllegalStateException
-//      * @since 3.0
-//      */
-//    void complete() throws IllegalStateException;
-//
-//    /**
-//     * Suspend request processing.  Must be called by a thread that is processing this request.
-//     * @param timeoutMilliseconds new timeout period, in milliseconds
-//     * @throws IllegalStateException if called by a thread not processing this request or after error dispatch
-//     * @since 3.0
-//     * @see #complete
-//     * @see #resume
-//     */
-//    void suspend(long timeoutMilliseconds) throws IllegalStateException;
-//
-//    /**
-//     * Similar to suspend(timeoutMilliseconds) but with a container supplied timeout period.
-//     * @throws IllegalStateException
-//     * @since 3.0
-//     * @see #complete
-//     * @see #resume
-//     */
-//    void suspend() throws IllegalStateException;
-//
-//    /**
-//     * Resume a suspended request
-//     * @throws IllegalStateException if the request is not suspended
-//     * @since 3.0
-//     * @see #suspend
-//     */
-//    void resume() throws IllegalStateException;
-//
-//    /**
-//     *
-//     * @return if the request is suspended
-//     * @since 3.0
-//     */
-//    boolean isSuspended();
-//
-//    /**
-//     *
-//     * @return if the request is resumed
-//     * @since 3.0
-//     */
-//    boolean isResumed();
-//
-//    /**
-//     *
-//     * @return if the request is timed out
-//     * @since 3.0
-//     */
-//    boolean isTimeout();
-//
-//    /**
-//     *
-//     * @return if the request has never been suspended (or resumed)
-//     * @since 3.0
-//     */
-//    boolean isInitial();
 }
 

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeEvent.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeEvent.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeEvent.java Wed Jun 24 22:05:48 2009
@@ -20,26 +20,29 @@
 package javax.servlet;
 
 
-    /** 
-      * This is the event class for notifications of changes to the 
-      * attributes of the servlet request in an application.
-      * @see ServletRequestAttributeListener
-      * @since	Servlet 2.4
-      */
-
-public class ServletRequestAttributeEvent extends ServletRequestEvent { 
-    private String name;
-    private Object value;
-
-     /** Construct a ServletRequestAttributeEvent giving the servlet context
-      * of this web application, the ServletRequest whose attributes are
-      * changing and the name and value of the attribute.
-      *
-      * @param sc		the ServletContext that is sending the event.
-      * @param request		the ServletRequest that is sending the event.
-      * @param name		the name of the request attribute.
-      * @param value		the value of the request attribute.
-      */
+/**
+ * This is the event class for notifications of changes to the
+ * attributes of the servlet request in an application.
+ *
+ * @since Servlet 2.4
+ * @see ServletRequestAttributeListener
+ * @version $Rev$ $Date$
+ */
+
+public class ServletRequestAttributeEvent extends ServletRequestEvent {
+    private final String name;
+    private final Object value;
+
+    /**
+     * Construct a ServletRequestAttributeEvent giving the servlet context
+     * of this web application, the ServletRequest whose attributes are
+     * changing and the name and value of the attribute.
+     *
+     * @param sc      the ServletContext that is sending the event.
+     * @param request the ServletRequest that is sending the event.
+     * @param name    the name of the request attribute.
+     * @param value   the value of the request attribute.
+     */
     public ServletRequestAttributeEvent(ServletContext sc, ServletRequest request, String name, Object value) {
         super(sc, request);
         this.name = name;
@@ -47,23 +50,23 @@
     }
 
     /**
-      * Return the name of the attribute that changed on the ServletRequest.
-      *
-      * @return		the name of the changed request attribute
-      */
+     * Return the name of the attribute that changed on the ServletRequest.
+     *
+     * @return the name of the changed request attribute
+     */
     public String getName() {
         return this.name;
     }
 
     /**
-      * Returns the value of the attribute that has been added, removed or 
-      * replaced. If the attribute was added, this is the value of the 
-      * attribute. If the attribute was removed, this is the value of the 
-      * removed attribute. If the attribute was replaced, this is the old 
-      * value of the attribute.
-      *
-      * @return		the value of the changed request attribute
-      */
+     * Returns the value of the attribute that has been added, removed or
+     * replaced. If the attribute was added, this is the value of the
+     * attribute. If the attribute was removed, this is the value of the
+     * removed attribute. If the attribute was replaced, this is the old
+     * value of the attribute.
+     *
+     * @return the value of the changed request attribute
+     */
     public Object getValue() {
         return this.value;   
     }

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeListener.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeListener.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestAttributeListener.java Wed Jun 24 22:05:48 2009
@@ -21,33 +21,37 @@
 
 import java.util.EventListener;
 
-    /**
-     * A ServletRequestAttributeListener can be implemented by the
-     * developer interested in being notified of request attribute
-     * changes. Notifications will be generated while the request
-     * is within the scope of the web application in which the listener
-     * is registered. A request is defined as coming into scope when
-     * it is about to enter the first servlet or filter in each web
-     * application, as going out of scope when it exits the last servlet
-     * or the first filter in the chain.
-     *
-     * @since Servlet 2.4
-     */
+/**
+ * A ServletRequestAttributeListener can be implemented by the
+ * developer interested in being notified of request attribute
+ * changes. Notifications will be generated while the request
+ * is within the scope of the web application in which the listener
+ * is registered. A request is defined as coming into scope when
+ * it is about to enter the first servlet or filter in each web
+ * application, as going out of scope when it exits the last servlet
+ * or the first filter in the chain.
+ *
+ * @since Servlet 2.4
+ * @version $Rev$ $Date$
+ */
 
 public interface ServletRequestAttributeListener extends EventListener {
-    /** Notification that a new attribute was added to the
-     ** servlet request. Called after the attribute is added.
+    /**
+     * Notification that a new attribute was added to the
+     * * servlet request. Called after the attribute is added.
      */
-    public void attributeAdded(ServletRequestAttributeEvent srae);
+    void attributeAdded(ServletRequestAttributeEvent srae);
 
-    /** Notification that an existing attribute has been removed from the
-     ** servlet request. Called after the attribute is removed.
+    /**
+     * Notification that an existing attribute has been removed from the
+     * * servlet request. Called after the attribute is removed.
      */
-    public void attributeRemoved(ServletRequestAttributeEvent srae);
+    void attributeRemoved(ServletRequestAttributeEvent srae);
 
-    /** Notification that an attribute was replaced on the
-     ** servlet request. Called after the attribute is replaced.
+    /**
+     * Notification that an attribute was replaced on the
+     * * servlet request. Called after the attribute is replaced.
      */
-    public void attributeReplaced(ServletRequestAttributeEvent srae);
+    void attributeReplaced(ServletRequestAttributeEvent srae);
 }
 

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestEvent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestEvent.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestEvent.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestEvent.java Wed Jun 24 22:05:48 2009
@@ -20,40 +20,44 @@
 package javax.servlet;
 
 
-    /** 
-      * Events of this kind indicate lifecycle
-      * events for a ServletRequest.
-      * The source of the event
-      * is the ServletContext of this web application.
-      * @see ServletRequestListener
-      * @since	Servlet 2.4
-      */
-
-public class ServletRequestEvent extends java.util.EventObject { 
-    private ServletRequest request;
-
-    /** Construct a ServletRequestEvent for the given ServletContext
-      * and ServletRequest.
-      *
-      * @param sc		the ServletContext of the web application.
-      * @param request		the ServletRequest that is sending the event.
-      */
+/**
+ * Events of this kind indicate lifecycle
+ * events for a ServletRequest.
+ * The source of the event
+ * is the ServletContext of this web application.
+ *
+ * @since Servlet 2.4
+ * @see ServletRequestListener
+ * @version $Rev$ $Date$
+ */
+
+public class ServletRequestEvent extends java.util.EventObject {
+
+    private final ServletRequest request;
+
+    /**
+     * Construct a ServletRequestEvent for the given ServletContext
+     * and ServletRequest.
+     *
+     * @param sc      the ServletContext of the web application.
+     * @param request the ServletRequest that is sending the event.
+     */
     public ServletRequestEvent(ServletContext sc, ServletRequest request) {
         super(sc);
         this.request = request;
     }
-    
+
     /**
-      * Returns the ServletRequest that is changing.
-      */
-    public ServletRequest getServletRequest () { 
-        return this.request;
+     * Returns the ServletRequest that is changing.
+     */
+    public ServletRequest getServletRequest() {
+        return request;
     }
 
     /**
-      * Returns the ServletContext of this web application.
-      */
-    public ServletContext getServletContext () { 
+     * Returns the ServletContext of this web application.
+     */
+    public ServletContext getServletContext() {
         return (ServletContext) super.getSource();
     }
 }

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestListener.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestListener.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestListener.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestListener.java Wed Jun 24 22:05:48 2009
@@ -30,9 +30,9 @@
  * the last servlet or the first filter in the chain.
  *
  * @since Servlet 2.4
+ * @version $Rev$ $Date$
  */
 
-
 public interface ServletRequestListener extends EventListener {
 
     /**
@@ -40,33 +40,13 @@
      *
      * @param sre event containing request
      */
-    public void requestDestroyed(ServletRequestEvent sre);
+    void requestDestroyed(ServletRequestEvent sre);
 
     /**
      * The request is about to come into scope of the web application.
      *
      * @param sre event containing request
      */
-    public void requestInitialized(ServletRequestEvent sre);
-
-    /**
-     * Called after suspend
-     * @param sre event containing request
-     * @since 3.0
-     */
-    void requestSuspended(ServletRequestEvent sre);
-
-    /**
-     * called before resume
-     * @param sre event containing request
-     * @since 3.0
-     */
-    void requestResumed(ServletRequestEvent sre);
+    void requestInitialized(ServletRequestEvent sre);
 
-    /**
-     * called after completion
-     * @param sre event containing request
-     * @since 3.0
-     */
-    void requestCompleted(ServletRequestEvent sre);
 }

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestWrapper.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestWrapper.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletRequestWrapper.java Wed Jun 24 22:05:48 2009
@@ -26,356 +26,274 @@
 import java.util.Map;
 
 
-
 /**
- * 
  * Provides a convenient implementation of the ServletRequest interface that
  * can be subclassed by developers wishing to adapt the request to a Servlet.
  * This class implements the Wrapper or Decorator pattern. Methods default to
  * calling through to the wrapped request object.
-  * @since	v 2.3
- * 
- * 
- *
- * @see 	javax.servlet.ServletRequest
  *
+ * @version $Rev$ $Date$
+ * @see javax.servlet.ServletRequest
+ * @since v 2.3
  */
 
 public class ServletRequestWrapper implements ServletRequest {
     private ServletRequest request;
 
-	/**
-	* Creates a ServletRequest adaptor wrapping the given request object. 
-	* @throws java.lang.IllegalArgumentException if the request is null
-	*/
-
+    /**
+     * Creates a ServletRequest adaptor wrapping the given request object.
+     *
+     * @param request request for this wrapper
+     * @throws java.lang.IllegalArgumentException
+     *          if the request is null
+     */
     public ServletRequestWrapper(ServletRequest request) {
-	if (request == null) {
-	    throw new IllegalArgumentException("Request cannot be null");   
-	}
-	this.request = request;
-    }
-
-	/**
-	* Return the wrapped request object.
-	*/
-	public ServletRequest getRequest() {
-		return this.request;
-	}
-	
-	/**
-	* Sets the request object being wrapped. 
-	* @throws java.lang.IllegalArgumentException if the request is null.
-	*/
-	
-	public void setRequest(ServletRequest request) {
-	    if (request == null) {
-		throw new IllegalArgumentException("Request cannot be null");
-	    }
-	    this.request = request;
-	}
+        if (request == null) {
+            throw new IllegalArgumentException("Request cannot be null");
+        }
+        this.request = request;
+    }
+
+    /**
+     * Return the wrapped request object.
+     *
+     * @return the request for this wrapper
+     */
+    public ServletRequest getRequest() {
+        return this.request;
+    }
 
     /**
+     * Sets the request object being wrapped.
      *
+     * @param request request to set
+     * @throws java.lang.IllegalArgumentException
+     *          if the request is null.
+     */
+    public void setRequest(ServletRequest request) {
+        if (request == null) {
+            throw new IllegalArgumentException("Request cannot be null");
+        }
+        this.request = request;
+    }
+
+    /**
      * The default behavior of this method is to call getAttribute(String name)
      * on the wrapped request object.
      */
-
     public Object getAttribute(String name) {
-	return this.request.getAttribute(name);
-	}
-    
-    
+        return this.request.getAttribute(name);
+    }
 
     /**
      * The default behavior of this method is to return getAttributeNames()
      * on the wrapped request object.
      */
+    public Enumeration<String> getAttributeNames() {
+        return this.request.getAttributeNames();
+    }
 
-    public Enumeration getAttributeNames() {
-	return this.request.getAttributeNames();
-	}    
-    
-    
-    
     /**
-      * The default behavior of this method is to return getCharacterEncoding()
+     * The default behavior of this method is to return getCharacterEncoding()
      * on the wrapped request object.
      */
-
     public String getCharacterEncoding() {
-	return this.request.getCharacterEncoding();
-	}
-	
+        return this.request.getCharacterEncoding();
+    }
+
     /**
-      * The default behavior of this method is to set the character encoding
+     * The default behavior of this method is to set the character encoding
      * on the wrapped request object.
      */
-
     public void setCharacterEncoding(String enc) throws java.io.UnsupportedEncodingException {
-	this.request.setCharacterEncoding(enc);
-	}
-    
-    
+        this.request.setCharacterEncoding(enc);
+    }
+
     /**
-      * The default behavior of this method is to return getContentLength()
+     * The default behavior of this method is to return getContentLength()
      * on the wrapped request object.
      */
-
     public int getContentLength() {
-	return this.request.getContentLength();
+        return this.request.getContentLength();
     }
-    
-    
-    
 
-       /**
-      * The default behavior of this method is to return getContentType()
+    /**
+     * The default behavior of this method is to return getContentType()
      * on the wrapped request object.
      */
     public String getContentType() {
-	return this.request.getContentType();
+        return this.request.getContentType();
     }
-    
-    
-    
 
-     /**
-      * The default behavior of this method is to return getInputStream()
+    /**
+     * The default behavior of this method is to return getInputStream()
      * on the wrapped request object.
      */
-
     public ServletInputStream getInputStream() throws IOException {
-	return this.request.getInputStream();
-	}
-     
-    
-    
+        return this.request.getInputStream();
+    }
 
     /**
-      * The default behavior of this method is to return getParameter(String name)
+     * The default behavior of this method is to return getParameter(String name)
      * on the wrapped request object.
      */
-
     public String getParameter(String name) {
-	return this.request.getParameter(name);
+        return this.request.getParameter(name);
     }
-    
+
     /**
-      * The default behavior of this method is to return getParameterMap()
+     * The default behavior of this method is to return getParameterMap()
      * on the wrapped request object.
      */
-    public Map getParameterMap() {
-	return this.request.getParameterMap();
+    public Map<String, String[]> getParameterMap() {
+        return this.request.getParameterMap();
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to return getParameterNames()
+     * The default behavior of this method is to return getParameterNames()
      * on the wrapped request object.
      */
-     
-    public Enumeration getParameterNames() {
-	return this.request.getParameterNames();
+    public Enumeration<String> getParameterNames() {
+        return this.request.getParameterNames();
     }
-    
-    
-    
 
-       /**
-      * The default behavior of this method is to return getParameterValues(String name)
+    /**
+     * The default behavior of this method is to return getParameterValues(String name)
      * on the wrapped request object.
      */
     public String[] getParameterValues(String name) {
-	return this.request.getParameterValues(name);
-	}
-    
-    
-    
+        return this.request.getParameterValues(name);
+    }
 
-     /**
-      * The default behavior of this method is to return getProtocol()
+    /**
+     * The default behavior of this method is to return getProtocol()
      * on the wrapped request object.
      */
-    
     public String getProtocol() {
-	return this.request.getProtocol();
-	}
-    
-    
-    
+        return this.request.getProtocol();
+    }
 
     /**
-      * The default behavior of this method is to return getScheme()
+     * The default behavior of this method is to return getScheme()
      * on the wrapped request object.
      */
-    
-
     public String getScheme() {
-	return this.request.getScheme();
-	}
-    
-    
-    
+        return this.request.getScheme();
+    }
 
     /**
-      * The default behavior of this method is to return getServerName()
+     * The default behavior of this method is to return getServerName()
      * on the wrapped request object.
      */
     public String getServerName() {
-	return this.request.getServerName();
-	}
-    
-    
-    
+        return this.request.getServerName();
+    }
 
-   /**
-      * The default behavior of this method is to return getServerPort()
+    /**
+     * The default behavior of this method is to return getServerPort()
      * on the wrapped request object.
      */
-
     public int getServerPort() {
-	return this.request.getServerPort();
-	}
-    
-    
-    
-  /**
-      * The default behavior of this method is to return getReader()
+        return this.request.getServerPort();
+    }
+
+    /**
+     * The default behavior of this method is to return getReader()
      * on the wrapped request object.
      */
-
     public BufferedReader getReader() throws IOException {
-	return this.request.getReader();
-	}
-    
-    
-    
+        return this.request.getReader();
+    }
 
     /**
-      * The default behavior of this method is to return getRemoteAddr()
+     * The default behavior of this method is to return getRemoteAddr()
      * on the wrapped request object.
      */
-    
     public String getRemoteAddr() {
-	return this.request.getRemoteAddr();
+        return this.request.getRemoteAddr();
     }
-    
-    
-    
 
-      /**
-      * The default behavior of this method is to return getRemoteHost()
+    /**
+     * The default behavior of this method is to return getRemoteHost()
      * on the wrapped request object.
      */
-
     public String getRemoteHost() {
-	return this.request.getRemoteHost();
+        return this.request.getRemoteHost();
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to return setAttribute(String name, Object o)
+     * The default behavior of this method is to return setAttribute(String name, Object o)
      * on the wrapped request object.
      */
-
     public void setAttribute(String name, Object o) {
-	this.request.setAttribute(name, o);
+        this.request.setAttribute(name, o);
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to call removeAttribute(String name)
+     * The default behavior of this method is to call removeAttribute(String name)
      * on the wrapped request object.
      */
     public void removeAttribute(String name) {
-	this.request.removeAttribute(name);
+        this.request.removeAttribute(name);
     }
-    
-    
-    
 
-   /**
-      * The default behavior of this method is to return getLocale()
+    /**
+     * The default behavior of this method is to return getLocale()
      * on the wrapped request object.
      */
-
     public Locale getLocale() {
-	return this.request.getLocale();
+        return this.request.getLocale();
     }
-    
-    
-    
 
-     /**
-      * The default behavior of this method is to return getLocales()
+    /**
+     * The default behavior of this method is to return getLocales()
      * on the wrapped request object.
      */
-
-    public Enumeration getLocales() {
-	return this.request.getLocales();
+    public Enumeration<Locale> getLocales() {
+        return this.request.getLocales();
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to return isSecure()
+     * The default behavior of this method is to return isSecure()
      * on the wrapped request object.
      */
-
     public boolean isSecure() {
-	return this.request.isSecure();
+        return this.request.isSecure();
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to return getRequestDispatcher(String path)
+     * The default behavior of this method is to return getRequestDispatcher(String path)
      * on the wrapped request object.
      */
-
     public RequestDispatcher getRequestDispatcher(String path) {
-	return this.request.getRequestDispatcher(path);
+        return this.request.getRequestDispatcher(path);
     }
-    
-    
-    
 
     /**
-      * The default behavior of this method is to return getRealPath(String path)
+     * The default behavior of this method is to return getRealPath(String path)
      * on the wrapped request object.
      */
-
     public String getRealPath(String path) {
-	return this.request.getRealPath(path);
+        return this.request.getRealPath(path);
     }
-    
+
     /**
      * The default behavior of this method is to return
      * getRemotePort() on the wrapped request object.
      *
      * @since 2.4
-     */    
-    public int getRemotePort(){
+     */
+    public int getRemotePort() {
         return this.request.getRemotePort();
     }
 
-
     /**
      * The default behavior of this method is to return
      * getLocalName() on the wrapped request object.
      *
      * @since 2.4
      */
-    public String getLocalName(){
+    public String getLocalName() {
         return this.request.getLocalName();
     }
 
@@ -384,19 +302,18 @@
      * getLocalAddr() on the wrapped request object.
      *
      * @since 2.4
-     */       
-    public String getLocalAddr(){
+     */
+    public String getLocalAddr() {
         return this.request.getLocalAddr();
     }
 
-
     /**
      * The default behavior of this method is to return
      * getLocalPort() on the wrapped request object.
      *
      * @since 2.4
      */
-    public int getLocalPort(){
+    public int getLocalPort() {
         return this.request.getLocalPort();
     }
 
@@ -410,16 +327,6 @@
         return request.getServletContext();
     }
 
-    /**
-     * Gets the associated servlet response.
-     *
-     * @return the ServletResponse associated with this request.
-     * @since 3.0
-     */
-    public ServletResponse getServletResponse() {
-        return request.getServletResponse();
-    }
-
     public void addAsyncListener(AsyncListener listener) {
         request.addAsyncListener(listener);
     }
@@ -432,6 +339,10 @@
         return request.getAsyncContext();
     }
 
+    public long getAsyncTimeout() {
+        return request.getAsyncTimeout();
+    }
+
     public boolean isAsyncStarted() {
         return request.isAsyncStarted();
     }
@@ -456,83 +367,5 @@
         return request.getDispatcherType();
     }
 
-//    /**
-//     * complete a suspended request.
-//     *
-//     * @throws IllegalStateException
-//     * @since 3.0
-//     */
-//    public void complete() throws IllegalStateException {
-//        request.complete();
-//    }
-//
-//    /**
-//     * Suspend request processing.  Must be called by a thread that is processing this request.
-//     *
-//     * @param timeoutMilliseconds new timeout period, in milliseconds
-//     * @throws IllegalStateException if called by a thread not processing this request or after error dispatch
-//     * @see #complete
-//     * @see #resume
-//     * @since 3.0
-//     */
-//    public void suspend(long timeoutMilliseconds) throws IllegalStateException {
-//        request.suspend(timeoutMilliseconds);
-//    }
-//
-//    /**
-//     * Similar to suspend(timeoutMilliseconds) but with a container supplied timeout period.
-//     *
-//     * @throws IllegalStateException
-//     * @see #complete
-//     * @see #resume
-//     * @since 3.0
-//     */
-//    public void suspend() throws IllegalStateException {
-//        request.suspend();
-//    }
-//
-//    /**
-//     * Resume a suspended request
-//     *
-//     * @throws IllegalStateException if the request is not suspended
-//     * @see #suspend
-//     * @since 3.0
-//     */
-//    public void resume() throws IllegalStateException {
-//        request.resume();
-//    }
-//
-//    /**
-//     * @return if the request is suspended
-//     * @since 3.0
-//     */
-//    public boolean isSuspended() {
-//        return request.isSuspended();
-//    }
-//
-//    /**
-//     * @return if the request is resumed
-//     * @since 3.0
-//     */
-//    public boolean isResumed() {
-//        return request.isResumed();
-//    }
-//
-//    /**
-//     * @return if the request is timed out
-//     * @since 3.0
-//     */
-//    public boolean isTimeout() {
-//        return request.isTimeout();
-//    }
-//
-//    /**
-//     * @return if the request has never been suspended (or resumed)
-//     * @since 3.0
-//     */
-//    public boolean isInitial() {
-//        return request.isInitial();
-//    }
-
 }
 

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponse.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponse.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponse.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponse.java Wed Jun 24 22:05:48 2009
@@ -28,15 +28,15 @@
  * Defines an object to assist a servlet in sending a response to the client.
  * The servlet container creates a <code>ServletResponse</code> object and
  * passes it as an argument to the servlet's <code>service</code> method.
- *
+ * <p/>
  * <p>To send binary data in a MIME body response, use
  * the {@link ServletOutputStream} returned by {@link #getOutputStream}.
- * To send character data, use the <code>PrintWriter</code> object 
+ * To send character data, use the <code>PrintWriter</code> object
  * returned by {@link #getWriter}. To mix binary and text data,
  * for example, to create a multipart response, use a
  * <code>ServletOutputStream</code> and manage the character sections
  * manually.
- *
+ * <p/>
  * <p>The charset for the MIME body response can be specified
  * explicitly using the {@link #setCharacterEncoding} and
  * {@link #setContentType} methods, or implicitly
@@ -47,24 +47,43 @@
  * <code>setContentType</code>, or <code>setLocale</code> method must
  * be called before <code>getWriter</code> and before committing
  * the response for the character encoding to be used.
- * 
- * <p>See the Internet RFCs such as 
+ * <p/>
+ * <p>See the Internet RFCs such as
  * <a href="http://www.ietf.org/rfc/rfc2045.txt">
  * RFC 2045</a> for more information on MIME. Protocols such as SMTP
  * and HTTP define profiles of MIME, and those standards
  * are still evolving.
  *
- * @author 	Various
- * @version 	$Version$
- *
- * @see		ServletOutputStream
- *
+ * @version $Rev$ $Date$
+ * @see                ServletOutputStream
  */
- 
+
 public interface ServletResponse {
 
+    /**
+     * Forces any content in the buffer to be written to the client.  A call
+     * to this method automatically commits the response, meaning the status
+     * code and headers will be written.
+     *
+     * @see #setBufferSize
+     * @see #getBufferSize
+     * @see #isCommitted
+     * @see #reset
+     */
+    void flushBuffer() throws IOException;
+
+    /**
+     * Returns the actual buffer size used for the response.  If no buffering
+     * is used, this method returns 0.
+     *
+     * @return the actual buffer size used
+     * @see #setBufferSize
+     * @see #flushBuffer
+     * @see #isCommitted
+     * @see #reset
+     */
+    int getBufferSize();
 
-    
     /**
      * Returns the name of the character encoding (MIME charset)
      * used for the body sent in this response.
@@ -80,15 +99,11 @@
      * <p>See RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
      * for more information about character encoding and MIME.
      *
-     * @return		a <code>String</code> specifying the
-     *			name of the character encoding, for
-     *			example, <code>UTF-8</code>
-     *
+     * @return a <code>String</code> specifying the
+     * name of the character encoding, for
+     * example, <code>UTF-8</code>
      */
-  
-    public String getCharacterEncoding();
-    
-    
+    String getCharacterEncoding();
 
     /**
      * Returns the content type used for the MIME body
@@ -103,42 +118,43 @@
      * If no character encoding has been specified, the
      * charset parameter is omitted.
      *
-     * @return		a <code>String</code> specifying the
-     *			content type, for example,
-     *			<code>text/html; charset=UTF-8</code>,
-     *			or null
-     *
+     * @return a <code>String</code> specifying the
+     * content type, for example,
+     * <code>text/html; charset=UTF-8</code>,
+     * or null
      * @since 2.4
      */
-  
-    public String getContentType();
-    
-    
+    String getContentType();
 
     /**
-     * Returns a {@link ServletOutputStream} suitable for writing binary 
+     * Returns the locale specified for this response
+     * using the {@link #setLocale} method. Calls made to
+     * <code>setLocale</code> after the response is committed
+     * have no effect. If no locale has been specified,
+     * the container's default locale is returned.
+     *
+     * @return locale specified for this response
+     * @see #setLocale
+     */
+    Locale getLocale();
+
+    /**
+     * Returns a {@link ServletOutputStream} suitable for writing binary
      * data in the response. The servlet container does not encode the
-     * binary data.  
-     
+     * binary data.
+     * <p/>
      * <p> Calling flush() on the ServletOutputStream commits the response.
-     
-     * Either this method or {@link #getWriter} may 
+     * <p/>
+     * Either this method or {@link #getWriter} may
      * be called to write the body, not both.
      *
-     * @return				a {@link ServletOutputStream} for writing binary data	
-     *
-     * @exception IllegalStateException if the <code>getWriter</code> method
-     * 					has been called on this response
-     *
-     * @exception IOException 		if an input or output exception occurred
-     *
-     * @see 				#getWriter
-     *
+     * @throws IllegalStateException if the <code>getWriter</code> method
+     *                               has been called on this response
+     * @throws IOException           if an input or output exception occurred
+     * @return a {@link ServletOutputStream} for writing binary data
+     * @see #getWriter
      */
-
-    public ServletOutputStream getOutputStream() throws IOException;
-    
-    
+    ServletOutputStream getOutputStream() throws IOException;
 
     /**
      * Returns a <code>PrintWriter</code> object that
@@ -147,7 +163,7 @@
      * encoding returned by {@link #getCharacterEncoding}.
      * If the response's character encoding has not been
      * specified as described in <code>getCharacterEncoding</code>
-     * (i.e., the method just returns the default value 
+     * (i.e., the method just returns the default value
      * <code>ISO-8859-1</code>), <code>getWriter</code>
      * updates it to <code>ISO-8859-1</code>.
      * <p>Calling flush() on the <code>PrintWriter</code>
@@ -155,32 +171,89 @@
      * <p>Either this method or {@link #getOutputStream} may be called
      * to write the body, not both.
      *
-     * 
-     * @return 		a <code>PrintWriter</code> object that 
-     *			can return character data to the client 
-     *
-     * @exception java.io.UnsupportedEncodingException
-     *			if the character encoding returned
-     *			by <code>getCharacterEncoding</code> cannot be used
+     * @return a <code>PrintWriter</code> object that
+     *         can return character data to the client
+     * @throws java.io.UnsupportedEncodingException
+     *                               if the character encoding returned
+     *                               by <code>getCharacterEncoding</code> cannot be used
+     * @throws IllegalStateException if the <code>getOutputStream</code>
+     *                               method has already been called for this
+     *                               response object
+     * @throws IOException           if an input or output exception occurred
+     * @see #getOutputStream
+     * @see #setCharacterEncoding
+     */
+    PrintWriter getWriter() throws IOException;
+
+    /**
+     * Returns a boolean indicating if the response has been
+     * committed.  A committed response has already had its status
+     * code and headers written.
      *
-     * @exception IllegalStateException
-     *			if the <code>getOutputStream</code>
-     * 			method has already been called for this 
-     *			response object
+     * @return a boolean indicating if the response has been
+     * committed
+     * @see #setBufferSize
+     * @see #getBufferSize
+     * @see #flushBuffer
+     * @see #reset
+     */
+    boolean isCommitted();
+
+    /**
+     * Clears any data that exists in the buffer as well as the status code and
+     * headers.  If the response has been committed, this method throws an
+     * <code>IllegalStateException</code>.
      *
-     * @exception IOException
-     *			if an input or output exception occurred
+     * @throws IllegalStateException if the response has already been
+     *                               committed
+     * @see #setBufferSize
+     * @see #getBufferSize
+     * @see #flushBuffer
+     * @see #isCommitted
+     */
+    void reset();
+
+    /**
+     * Clears the content of the underlying buffer in the response without
+     * clearing headers or status code. If the
+     * response has been committed, this method throws an
+     * <code>IllegalStateException</code>.
      *
-     * @see 		#getOutputStream
-     * @see 		#setCharacterEncoding
+     * @see #setBufferSize
+     * @see #getBufferSize
+     * @see #isCommitted
+     * @see #reset
+     * @since 2.3
+     */
+    void resetBuffer();
+
+    /**
+     * Sets the preferred buffer size for the body of the response.
+     * The servlet container will use a buffer at least as large as
+     * the size requested.  The actual buffer size used can be found
+     * using <code>getBufferSize</code>.
+     * <p/>
+     * <p>A larger buffer allows more content to be written before anything is
+     * actually sent, thus providing the servlet with more time to set
+     * appropriate status codes and headers.  A smaller buffer decreases
+     * server memory load and allows the client to start receiving data more
+     * quickly.
+     * <p/>
+     * <p>This method must be called before any response body content is
+     * written; if content has been written or the response object has
+     * been committed, this method throws an
+     * <code>IllegalStateException</code>.
      *
+     * @param size the preferred buffer size
+     * @throws IllegalStateException if this method is called after
+     *                               content has been written
+     * @see #getBufferSize
+     * @see #flushBuffer
+     * @see #isCommitted
+     * @see #reset
      */
+    void setBufferSize(int size);
 
-    public PrintWriter getWriter() throws IOException;
-    
-    
-    
-    
     /**
      * Sets the character encoding (MIME charset) of the response
      * being sent to the client, for example, to UTF-8.
@@ -207,36 +280,23 @@
      * specify a content type; however, it is still used to encode text
      * written via the servlet response's writer.
      *
-     * @param charset 	a String specifying only the character set
-     * 			defined by IANA Character Sets
-     *			(http://www.iana.org/assignments/character-sets)
-     *
-     * @see		#setContentType
-     * 			#setLocale
-     *
+     * @param charset a String specifying only the character set
+     *                defined by IANA Character Sets
+     *                (http://www.iana.org/assignments/character-sets)
+     * @see                #setContentType #setLocale
      * @since 2.4
-     *
      */
-
-    public void setCharacterEncoding(String charset);
-    
-    
-
+    void setCharacterEncoding(String charset);
 
     /**
      * Sets the length of the content body in the response
      * In HTTP servlets, this method sets the HTTP Content-Length header.
      *
-     *
-     * @param len 	an integer specifying the length of the 
-     * 			content being returned to the client; sets
-     *			the Content-Length header
-     *
+     * @param len an integer specifying the length of the
+     *            content being returned to the client; sets
+     *            the Content-Length header
      */
-
-    public void setContentLength(int len);
-    
-    
+    void setContentLength(int len);
 
     /**
      * Sets the content type of the response being sent to
@@ -257,139 +317,15 @@
      * the protocol provides a way for doing so. In the case of HTTP,
      * the <code>Content-Type</code> header is used.
      *
-     * @param type 	a <code>String</code> specifying the MIME 
-     *			type of the content
-     *
-     * @see 		#setLocale
-     * @see 		#setCharacterEncoding
-     * @see 		#getOutputStream
-     * @see 		#getWriter
-     *
-     */
-
-    public void setContentType(String type);
-    
-
-    /**
-     * Sets the preferred buffer size for the body of the response.  
-     * The servlet container will use a buffer at least as large as 
-     * the size requested.  The actual buffer size used can be found
-     * using <code>getBufferSize</code>.
-     *
-     * <p>A larger buffer allows more content to be written before anything is
-     * actually sent, thus providing the servlet with more time to set
-     * appropriate status codes and headers.  A smaller buffer decreases 
-     * server memory load and allows the client to start receiving data more
-     * quickly.
-     *
-     * <p>This method must be called before any response body content is
-     * written; if content has been written or the response object has
-     * been committed, this method throws an 
-     * <code>IllegalStateException</code>.
-     *
-     * @param size 	the preferred buffer size
-     *
-     * @exception  IllegalStateException  	if this method is called after
-     *						content has been written
-     *
-     * @see 		#getBufferSize
-     * @see 		#flushBuffer
-     * @see 		#isCommitted
-     * @see 		#reset
-     *
-     */
-
-    public void setBufferSize(int size);
-    
-    
-
-    /**
-     * Returns the actual buffer size used for the response.  If no buffering
-     * is used, this method returns 0.
-     *
-     * @return	 	the actual buffer size used
-     *
-     * @see 		#setBufferSize
-     * @see 		#flushBuffer
-     * @see 		#isCommitted
-     * @see 		#reset
-     *
-     */
-
-    public int getBufferSize();
-    
-    
-
-    /**
-     * Forces any content in the buffer to be written to the client.  A call
-     * to this method automatically commits the response, meaning the status 
-     * code and headers will be written.
-     *
-     * @see 		#setBufferSize
-     * @see 		#getBufferSize
-     * @see 		#isCommitted
-     * @see 		#reset
-     *
-     */
-
-    public void flushBuffer() throws IOException;
-    
-    
-    
-    /**
-     * Clears the content of the underlying buffer in the response without
-     * clearing headers or status code. If the 
-     * response has been committed, this method throws an 
-     * <code>IllegalStateException</code>.
-     *
-     * @see 		#setBufferSize
-     * @see 		#getBufferSize
-     * @see 		#isCommitted
-     * @see 		#reset
-     *
-     * @since 2.3
-     */
-
-    public void resetBuffer();
-    
-
-    /**
-     * Returns a boolean indicating if the response has been
-     * committed.  A committed response has already had its status 
-     * code and headers written.
-     *
-     * @return		a boolean indicating if the response has been
-     *  		committed
-     *
-     * @see 		#setBufferSize
-     * @see 		#getBufferSize
-     * @see 		#flushBuffer
-     * @see 		#reset
-     *
-     */
-
-    public boolean isCommitted();
-    
-    
-
-    /**
-     * Clears any data that exists in the buffer as well as the status code and
-     * headers.  If the response has been committed, this method throws an 
-     * <code>IllegalStateException</code>.
-     *
-     * @exception IllegalStateException  if the response has already been
-     *                                   committed
-     *
-     * @see 		#setBufferSize
-     * @see 		#getBufferSize
-     * @see 		#flushBuffer
-     * @see 		#isCommitted
-     *
+     * @param type a <code>String</code> specifying the MIME
+     *             type of the content
+     * @see #setLocale
+     * @see #setCharacterEncoding
+     * @see #getOutputStream
+     * @see #getWriter
      */
+    void setContentType(String type);
 
-    public void reset();
-    
-    
 
     /**
      * Sets the locale of the response, if the response has not been
@@ -398,7 +334,7 @@
      * been explicitly set using {@link #setContentType} or
      * {@link #setCharacterEncoding}, <code>getWriter</code> hasn't
      * been called yet, and the response hasn't been committed yet.
-     * If the deployment descriptor contains a 
+     * If the deployment descriptor contains a
      * <code>locale-encoding-mapping-list</code> element, and that
      * element provides a mapping for the given locale, that mapping
      * is used. Otherwise, the mapping from locale to character
@@ -420,51 +356,13 @@
      * cannot be communicated via HTTP headers if the servlet does not
      * specify a content type; however, it is still used to encode text
      * written via the servlet response's writer.
-     * 
-     * @param loc  the locale of the response
-     *
-     * @see 		#getLocale
-     * @see 		#setContentType
-     * @see 		#setCharacterEncoding
      *
+     * @param loc the locale of the response
+     * @see #getLocale
+     * @see #setContentType
+     * @see #setCharacterEncoding
      */
-
-    public void setLocale(Locale loc);
-    
-    
-
-    /**
-     * Returns the locale specified for this response
-     * using the {@link #setLocale} method. Calls made to
-     * <code>setLocale</code> after the response is committed
-     * have no effect. If no locale has been specified,
-     * the container's default locale is returned.
-     * 
-     * @return locale specified for this response
-     * @see 		#setLocale
-     */
-
-    public Locale getLocale();
-
-    /**
-     * Helper for suspend/resume: disables output
-     * @since 3.0
-     */
-    void disable();
-
-    /**
-     * Helper for suspend/resume: enables output
-     * @since 3.0
-     */
-    void enable();
-
-    /**
-     * Helper for suspend/resume, shows disabled state
-     * @return true if disable is most recent disable/enable call
-     * @since 3.0
-     */
-    boolean isDisabled();
-
+    void setLocale(Locale loc);
 }
 
 

Modified: geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponseWrapper.java?rev=788194&r1=788193&r2=788194&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponseWrapper.java (original)
+++ geronimo/specs/trunk/geronimo-servlet_3.0_spec/src/main/java/javax/servlet/ServletResponseWrapper.java Wed Jun 24 22:05:48 2009
@@ -24,56 +24,55 @@
 import java.util.Locale;
 
 /**
- * 
  * Provides a convenient implementation of the ServletResponse interface that
  * can be subclassed by developers wishing to adapt the response from a Servlet.
  * This class implements the Wrapper or Decorator pattern. Methods default to
  * calling through to the wrapped response object.
- * 
- * @author 	Various
- * @version 	$Version$
- * @since	v 2.3
- *
- * @see 	javax.servlet.ServletResponse
  *
+ * @version $Rev$ $Date$
+ * @see javax.servlet.ServletResponse
+ * @since v 2.3
  */
 
- 
 public class ServletResponseWrapper implements ServletResponse {
-	private ServletResponse response;
-	/**
-	* Creates a ServletResponse adaptor wrapping the given response object.
-	* @throws java.lang.IllegalArgumentException if the response is null.
-	*/
-
-
-	public ServletResponseWrapper(ServletResponse response) {
-	    if (response == null) {
-		throw new IllegalArgumentException("Response cannot be null");
-	    }
-	    this.response = response;
-	}
-
-	/**
-	* Return the wrapped ServletResponse object.
-	*/
-
-	public ServletResponse getResponse() {
-		return this.response;
-	}	
-	
-	
-	/**
-	* Sets the response being wrapped. 
-	* @throws java.lang.IllegalArgumentException if the response is null.
-	*/
-	
-	public void setResponse(ServletResponse response) {
-	    if (response == null) {
-		throw new IllegalArgumentException("Response cannot be null");
-	    }
-	    this.response = response;
-	}
+    private ServletResponse response;
+
+    /**
+     * Creates a ServletResponse adaptor wrapping the given response object.
+     *
+     * @param response response to wrap
+     * @throws java.lang.IllegalArgumentException
+     *          if the response is null.
+     */
+    public ServletResponseWrapper(ServletResponse response) {
+        if (response == null) {
+            throw new IllegalArgumentException("Response cannot be null");
+        }
+        this.response = response;
+    }
+
+    /**
+     * Return the wrapped ServletResponse object.
+     *
+     * @return wrapped response
+     */
+    public ServletResponse getResponse() {
+        return this.response;
+    }
+
+    /**
+     * Sets the response being wrapped.
+     *
+     * @param response response to wrap
+     * @throws java.lang.IllegalArgumentException
+     *          if the response is null.
+     */
+    public void setResponse(ServletResponse response) {
+        if (response == null) {
+            throw new IllegalArgumentException("Response cannot be null");
+        }
+        this.response = response;
+    }
 
     /**
      * The default behavior of this method is to call setCharacterEncoding(String charset)
@@ -81,56 +80,48 @@
      *
      * @since 2.4
      */
-
     public void setCharacterEncoding(String charset) {
-	this.response.setCharacterEncoding(charset);
+        this.response.setCharacterEncoding(charset);
     }
 
     /**
      * The default behavior of this method is to return getCharacterEncoding()
      * on the wrapped response object.
      */
-
     public String getCharacterEncoding() {
-	return this.response.getCharacterEncoding();
-	}
-    
-    
-	  /**
+        return this.response.getCharacterEncoding();
+    }
+
+    /**
      * The default behavior of this method is to return getOutputStream()
      * on the wrapped response object.
      */
-
     public ServletOutputStream getOutputStream() throws IOException {
-	return this.response.getOutputStream();
-    }  
-      
-     /**
+        return this.response.getOutputStream();
+    }
+
+    /**
      * The default behavior of this method is to return getWriter()
      * on the wrapped response object.
      */
-
-
     public PrintWriter getWriter() throws IOException {
-	return this.response.getWriter();
-	}
-    
+        return this.response.getWriter();
+    }
+
     /**
      * The default behavior of this method is to call setContentLength(int len)
      * on the wrapped response object.
      */
-
     public void setContentLength(int len) {
-	this.response.setContentLength(len);
+        this.response.setContentLength(len);
     }
-    
+
     /**
      * The default behavior of this method is to call setContentType(String type)
      * on the wrapped response object.
      */
-
     public void setContentType(String type) {
-	this.response.setContentType(type);
+        this.response.setContentType(type);
     }
 
     /**
@@ -139,108 +130,74 @@
      *
      * @since 2.4
      */
-
     public String getContentType() {
-	return this.response.getContentType();
+        return this.response.getContentType();
     }
-    
+
     /**
      * The default behavior of this method is to call setBufferSize(int size)
      * on the wrapped response object.
      */
     public void setBufferSize(int size) {
-	this.response.setBufferSize(size);
+        this.response.setBufferSize(size);
     }
-    
+
     /**
      * The default behavior of this method is to return getBufferSize()
      * on the wrapped response object.
      */
     public int getBufferSize() {
-	return this.response.getBufferSize();
+        return this.response.getBufferSize();
     }
 
     /**
      * The default behavior of this method is to call flushBuffer()
      * on the wrapped response object.
      */
-
     public void flushBuffer() throws IOException {
-	this.response.flushBuffer();
+        this.response.flushBuffer();
     }
-    
+
     /**
      * The default behavior of this method is to return isCommitted()
      * on the wrapped response object.
      */
     public boolean isCommitted() {
-	return this.response.isCommitted();
+        return this.response.isCommitted();
     }
 
     /**
      * The default behavior of this method is to call reset()
      * on the wrapped response object.
      */
-
     public void reset() {
-	this.response.reset();
+        this.response.reset();
     }
-    
+
     /**
      * The default behavior of this method is to call resetBuffer()
      * on the wrapped response object.
      */
-     
     public void resetBuffer() {
-	this.response.resetBuffer();
+        this.response.resetBuffer();
     }
-    
+
     /**
      * The default behavior of this method is to call setLocale(Locale loc)
      * on the wrapped response object.
      */
-
     public void setLocale(Locale loc) {
-	this.response.setLocale(loc);
+        this.response.setLocale(loc);
     }
-    
+
     /**
      * The default behavior of this method is to return getLocale()
      * on the wrapped response object.
      */
     public Locale getLocale() {
-	return this.response.getLocale();
-    }
-
-    /**
-     * Helper for suspend/resume: disables output
-     *
-     * @since 3.0
-     */
-    public void disable() {
-        response.disable();
-    }
-
-    /**
-     * Helper for suspend/resume: enables output
-     *
-     * @since 3.0
-     */
-    public void enable() {
-        response.enable();
+        return this.response.getLocale();
     }
 
-    /**
-     * Helper for suspend/resume, shows disabled state
-     *
-     * @return true if disable is most recent disable/enable call
-     * @since 3.0
-     */
-    public boolean isDisabled() {
-        return response.isDisabled();
-    }
-
-
 }
 
 



Mime
View raw message