tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1239296 - in /tomcat/trunk/java/org/apache: catalina/Globals.java catalina/connector/CometEventImpl.java catalina/connector/Request.java coyote/Constants.java coyote/http11/AbstractHttp11Processor.java coyote/http11/Http11NioProcessor.java
Date Wed, 01 Feb 2012 20:10:22 GMT
Author: markt
Date: Wed Feb  1 20:10:21 2012
New Revision: 1239296

URL: http://svn.apache.org/viewvc?rev=1239296&view=rev
Log:
Hook up a few more constants

Modified:
    tomcat/trunk/java/org/apache/catalina/Globals.java
    tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/coyote/Constants.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.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=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Wed Feb  1 20:10:21 2012
@@ -154,9 +154,11 @@ public final class Globals {
      * per-connection request timeout through Comet API.
      *
      * @see org.apache.catalina.comet.CometEvent#setTimeout(int)
+     *
+     * Duplicated here for neater code in the catalina packages.
      */
     public static final String COMET_TIMEOUT_SUPPORTED_ATTR =
-        "org.apache.tomcat.comet.timeout.support";
+            org.apache.coyote.Constants.COMET_TIMEOUT_SUPPORTED_ATTR;
 
 
     /**
@@ -165,9 +167,11 @@ public final class Globals {
      * timeout for Comet API. The value is in milliseconds.
      *
      * @see org.apache.catalina.comet.CometEvent#setTimeout(int)
+     *
+     * Duplicated here for neater code in the catalina packages.
      */
     public static final String COMET_TIMEOUT_ATTR =
-        "org.apache.tomcat.comet.timeout";
+        org.apache.coyote.Constants.COMET_TIMEOUT_ATTR;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java?rev=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java Wed Feb  1 20:10:21
2012
@@ -22,6 +22,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.catalina.Globals;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -121,8 +122,10 @@ public class CometEventImpl implements C
     @Override
     public void setTimeout(int timeout) throws IOException, ServletException,
             UnsupportedOperationException {
-        if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE)
{
-            request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout));
+        if (request.getAttribute(Globals.COMET_TIMEOUT_SUPPORTED_ATTR) ==
+                Boolean.TRUE) {
+            request.setAttribute(Globals.COMET_TIMEOUT_ATTR,
+                    Integer.valueOf(timeout));
             if (request.isComet()) {
                 request.setCometTimeout(timeout);
             }

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=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Wed Feb  1 20:10:21 2012
@@ -942,9 +942,9 @@ public class Request
      * The underlying connector may also expose request attributes. These all
      * have names starting with "org.apache.tomcat" and include:
      * <ul>
-     * <li>org.apache.tomcat.sendfile.support</li>
-     * <li>{@link Globals#COMET_SUPPORTED_ATTR</li>
-     * <li>org.apache.tomcat.comet.timeout.support</li>
+     * <li>{@link Globals#SENDFILE_SUPPORTED_ATTR}</li>
+     * <li>{@link Globals#COMET_SUPPORTED_ATTR}</li>
+     * <li>{@link Globals#COMET_TIMEOUT_SUPPORTED_ATTR}</li>
      * </ul>
      * Connector implementations may return some, all or none of these
      * attributes and may also support additional attributes.

Modified: tomcat/trunk/java/org/apache/coyote/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Constants.java?rev=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/Constants.java (original)
+++ tomcat/trunk/java/org/apache/coyote/Constants.java Wed Feb  1 20:10:21 2012
@@ -67,4 +67,25 @@ public final class Constants {
     public static final String COMET_SUPPORTED_ATTR =
         "org.apache.tomcat.comet.support";
 
+
+    /**
+     * The request attribute that is set to the value of {@code Boolean.TRUE}
+     * if connector processing this request supports setting
+     * per-connection request timeout through Comet API.
+     *
+     * @see org.apache.catalina.comet.CometEvent#setTimeout(int)
+     */
+    public static final String COMET_TIMEOUT_SUPPORTED_ATTR =
+        "org.apache.tomcat.comet.timeout.support";
+
+
+    /**
+     * The request attribute that can be set to a value of type
+     * {@code java.lang.Integer} to specify per-connection request
+     * timeout for Comet API. The value is in milliseconds.
+     *
+     * @see org.apache.catalina.comet.CometEvent#setTimeout(int)
+     */
+    public static final String COMET_TIMEOUT_ATTR =
+        "org.apache.tomcat.comet.timeout";
 }

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=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Wed Feb  1 20:10:21
2012
@@ -1285,7 +1285,8 @@ public abstract class AbstractHttp11Proc
         }
         // Advertise comet timeout support
         if (endpoint.getUseCometTimeout()) {
-            request.setAttribute("org.apache.tomcat.comet.timeout.support",
+            request.setAttribute(
+                    org.apache.coyote.Constants.COMET_TIMEOUT_SUPPORTED_ATTR,
                     Boolean.TRUE);
         }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1239296&r1=1239295&r2=1239296&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Feb  1 20:10:21
2012
@@ -126,7 +126,8 @@ public class Http11NioProcessor extends 
                 if (attach != null) {
                     attach.setComet(comet);
                     if (comet) {
-                        Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout");
+                        Integer comettimeout = (Integer) request.getAttribute(
+                                org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
                         if (comettimeout != null) {
                             attach.setTimeout(comettimeout.longValue());
                         }
@@ -261,7 +262,8 @@ public class Http11NioProcessor extends 
             if (attach != null)  {
                 attach.setComet(comet);
                 if (comet) {
-                    Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout");
+                    Integer comettimeout = (Integer) request.getAttribute(
+                            org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
                     if (comettimeout != null) {
                         attach.setTimeout(comettimeout.longValue());
                     }



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


Mime
View raw message