Author: markt
Date: Tue Feb 28 20:24:22 2017
New Revision: 1784805

URL: http://svn.apache.org/viewvc?rev=1784805&view=rev
Log:
Servlet 4 EG discussion concluded that it was cleaner to remove 
isPushSupported() and simply return null from getPushBuilder()

Modified:
    tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/RequestFacade.java
    
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequest.java
    
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequestWrapper.java

Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/Request.java?rev=1784805&r1=1784804&r2=1784805&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/Request.java 
(original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/Request.java Tue 
Feb 28 20:24:22 2017
@@ -1911,28 +1911,21 @@ public class Request implements org.apac
      * Pulled forward from Servlet 4.0. The method signature may be modified,
      * removed or replaced at any time until Servlet 4.0 becomes final.
      *
-     * @return {@code true} If this request supports server push
+     * @return A builder to use to construct the push request
      */
     @Override
-    public boolean isPushSupported() {
+    public PushBuilder getPushBuilder() {
         AtomicBoolean result = new AtomicBoolean();
         coyoteRequest.action(ActionCode.IS_PUSH_SUPPORTED, result);
-        return result.get();
+        if (result.get()) {
+            return new ApplicationPushBuilder(this);
+        } else {
+            return null;
+        }
     }
 
 
     /**
-     * Pulled forward from Servlet 4.0. The method signature may be modified,
-     * removed or replaced at any time until Servlet 4.0 becomes final.
-     *
-     * @return A builder to use to construct the push request
-     */
-    @Override
-    public PushBuilder getPushBuilder() {
-        return new ApplicationPushBuilder(this);
-    }
-
-    /**
      * {@inheritDoc}
      *
      * @since Servlet 3.1

Modified: 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/RequestFacade.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=1784805&r1=1784804&r2=1784805&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/RequestFacade.java 
(original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/connector/RequestFacade.java 
Tue Feb 28 20:24:22 2017
@@ -1135,18 +1135,6 @@ public class RequestFacade implements Ht
      * removed or replaced at any time until Servlet 4.0 becomes final.
      */
     @Override
-    public boolean isPushSupported() {
-        return request.isPushSupported();
-    }
-
-
-    /**
-     * {@inheritDoc}
-     * <p>
-     * Pulled forward from Servlet 4.0. The method signature may be modified,
-     * removed or replaced at any time until Servlet 4.0 becomes final.
-     */
-    @Override
     public PushBuilder getPushBuilder() {
         return request.getPushBuilder();
     }

Modified: 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequest.java?rev=1784805&r1=1784804&r2=1784805&view=diff
==============================================================================
--- 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequest.java
 (original)
+++ 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequest.java
 Tue Feb 28 20:24:22 2017
@@ -24,23 +24,16 @@ public interface HttpServletRequest exte
     public ServletMapping getServletMapping();
 
     /**
-     * Does the current request allow push requests. This will return {@code
-     * true} only if the underlying protocol supports server push and if pushes
-     * are permitted from the current request.
-     *
-     * @return {@code true} if server push is supported for the current request
-     *         otherwise {@code false}
-     */
-    public boolean isPushSupported();
-
-    /**
      * Obtain a builder for generating push requests. {@link PushBuilder}
      * documents how this request will be used as the basis for a push request.
      * Each call to this method will return a new instance, independent of any
      * previous instance obtained.
      *
      * @return A builder that can be used to generate push requests based on
-     *         this request.
+     *         this request or {@code null} if push is not supported. Note that
+     *         even if a PushBuilder instance is returned, by the time that
+     *         {@link PushBuilder#push()} is called, it may no longer be valid
+     *         to push a request and the push request will be ignored.
      *
      * @since Servlet 4.0
      */

Modified: 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequestWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequestWrapper.java?rev=1784805&r1=1784804&r2=1784805&view=diff
==============================================================================
--- 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequestWrapper.java
 (original)
+++ 
tomcat/tc8.5.x/trunk/java/org/apache/catalina/servlet4preview/http/HttpServletRequestWrapper.java
 Tue Feb 28 20:24:22 2017
@@ -56,20 +56,6 @@ public class HttpServletRequestWrapper e
      * {@inheritDoc}
      * <p>
      * The default behavior of this method is to return
-     * {@link HttpServletRequest#isPushSupported()} on the wrapped request 
object.
-     *
-     * @since Servlet 4.0
-     */
-    @Override
-    public boolean isPushSupported() {
-        return this._getHttpServletRequest().isPushSupported();
-    }
-
-
-    /**
-     * {@inheritDoc}
-     * <p>
-     * The default behavior of this method is to return
      * {@link HttpServletRequest#getPushBuilder()} on the wrapped request 
object.
      *
      * @since Servlet 4.0



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

Reply via email to