tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1239285 - in /tomcat/trunk/java/org/apache: catalina/Globals.java catalina/connector/Request.java catalina/core/StandardWrapperValve.java coyote/Constants.java coyote/http11/AbstractHttp11Processor.java
Date Wed, 01 Feb 2012 19:44:00 GMT
Author: markt
Date: Wed Feb  1 19:44:00 2012
New Revision: 1239285

URL: http://svn.apache.org/viewvc?rev=1239285&view=rev
Log:
Start to hook up unused constants

Modified:
    tomcat/trunk/java/org/apache/catalina/Globals.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
    tomcat/trunk/java/org/apache/coyote/Constants.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=1239285&r1=1239284&r2=1239285&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Wed Feb  1 19:44:00 2012
@@ -142,9 +142,10 @@ public final class Globals {
     /**
      * The request attribute that is set to the value of {@code Boolean.TRUE}
      * if connector processing this request supports Comet API.
+     * Duplicated here for neater code in the catalina packages.
      */
     public static final String COMET_SUPPORTED_ATTR =
-        "org.apache.tomcat.comet.support";
+        org.apache.coyote.Constants.COMET_SUPPORTED_ATTR;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1239285&r1=1239284&r2=1239285&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Wed Feb  1 19:44:00 2012
@@ -943,7 +943,7 @@ public class Request
      * have names starting with "org.apache.tomcat" and include:
      * <ul>
      * <li>org.apache.tomcat.sendfile.support</li>
-     * <li>org.apache.tomcat.comet.support</li>
+     * <li>{@link Globals#COMET_SUPPORTED_ATTR</li>
      * <li>org.apache.tomcat.comet.timeout.support</li>
      * </ul>
      * Connector implementations may return some, all or none of these

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1239285&r1=1239284&r2=1239285&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Wed Feb  1 19:44:00
2012
@@ -29,6 +29,7 @@ import javax.servlet.UnavailableExceptio
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.comet.CometProcessor;
@@ -165,8 +166,8 @@ final class StandardWrapperValve
 
         // Identify if the request is Comet related now that the servlet has been allocated
         boolean comet = false;
-        if (servlet instanceof CometProcessor
-                && request.getAttribute("org.apache.tomcat.comet.support") == Boolean.TRUE)
{
+        if (servlet instanceof CometProcessor && request.getAttribute(
+                Globals.COMET_SUPPORTED_ATTR) == Boolean.TRUE) {
             comet = true;
             request.setComet(true);
         }

Modified: tomcat/trunk/java/org/apache/coyote/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Constants.java?rev=1239285&r1=1239284&r2=1239285&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/Constants.java (original)
+++ tomcat/trunk/java/org/apache/coyote/Constants.java Wed Feb  1 19:44:00 2012
@@ -59,4 +59,12 @@ public final class Constants {
         Boolean.valueOf(System.getProperty(
                 "org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
                 "false")).booleanValue();
+
+    /**
+     * The request attribute that is set to the value of {@code Boolean.TRUE}
+     * if connector processing this request supports Comet API.
+     */
+    public static final String COMET_SUPPORTED_ATTR =
+        "org.apache.tomcat.comet.support";
+
 }

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1239285&r1=1239284&r2=1239285&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Wed Feb  1 19:44:00
2012
@@ -1279,7 +1279,8 @@ public abstract class AbstractHttp11Proc
 
         // Advertise comet support through a request attribute
         if (endpoint.getUseComet()) {
-            request.setAttribute("org.apache.tomcat.comet.support",
+            request.setAttribute(
+                    org.apache.coyote.Constants.COMET_SUPPORTED_ATTR,
                     Boolean.TRUE);
         }
         // Advertise comet timeout support



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


Mime
View raw message