tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector Connector.java CoyoteAdapter.java
Date Mon, 04 Oct 2004 09:25:11 GMT
remm        2004/10/04 02:25:11

  Modified:    catalina/src/share/org/apache/catalina/connector
                        Connector.java CoyoteAdapter.java
  Log:
  - Switch to getIsPowered.
  - Add replacement for property names.
  - Add back bufferSize property (which isn't used).
  
  Revision  Changes    Path
  1.7       +43 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java
  
  Index: Connector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/Connector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Connector.java	3 Oct 2004 08:53:56 -0000	1.6
  +++ Connector.java	4 Oct 2004 09:25:11 -0000	1.7
  @@ -18,6 +18,8 @@
   package org.apache.catalina.connector;
   
   import java.net.URLEncoder;
  +import java.util.HashMap;
  +import java.util.Hashtable;
   
   import javax.management.MBeanRegistration;
   import javax.management.MBeanServer;
  @@ -251,6 +253,15 @@
        private boolean useBodyEncodingForURI = false;
   
   
  +     protected static HashMap replacements = new HashMap();
  +     static {
  +         replacements.put("acceptCount", "backlog");
  +         replacements.put("connectionLinger", "soLinger");
  +         replacements.put("connectionTimeout", "soTimeout");
  +         replacements.put("connectionUploadTimeout", "timeout");
  +     }
  +     
  +     
       // ------------------------------------------------------------- Properties
   
   
  @@ -258,7 +269,12 @@
        * Return a configured property.
        */
       public Object getProperty(String name) {
  -        return IntrospectionUtils.getProperty(protocolHandler, name);
  +        String repl = name;
  +        if (replacements.get(name) != null) {
  +            repl = (String) replacements.get(name);
  +        }
  +        log.info("get " + name + " as " + repl);
  +        return IntrospectionUtils.getProperty(protocolHandler, repl);
       }
   
       
  @@ -266,7 +282,11 @@
        * Set a configured property.
        */
       public void setProperty(String name, String value) {
  -        IntrospectionUtils.setProperty(protocolHandler, name, value);
  +        String repl = name;
  +        if (replacements.get(name) != null) {
  +            repl = (String) replacements.get(name);
  +        }
  +        IntrospectionUtils.setProperty(protocolHandler, repl, value);
       }
   
       
  @@ -351,6 +371,25 @@
   
   
       /**
  +     * Return the input buffer size for this Connector.
  +     * 
  +     * @deprecated
  +     */
  +    public int getBufferSize() {
  +        return 2048;
  +    }
  +
  +    /**
  +     * Set the input buffer size for this Connector.
  +     *
  +     * @param bufferSize The new input buffer size.
  +     * @deprecated
  +     */
  +    public void setBufferSize(int bufferSize) {
  +    }
  +
  +    
  +    /**
        * Return the Container used for processing requests received by this
        * Connector.
        */
  @@ -717,7 +756,7 @@
        * @return true if generation of X-Powered-By response header is enabled,
        * false otherwise
        */
  -    public boolean isXpoweredBy() {
  +    public boolean getXpoweredBy() {
           return xpoweredBy;
       }
   
  
  
  
  1.6       +2 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/CoyoteAdapter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CoyoteAdapter.java	29 Aug 2004 16:46:09 -0000	1.5
  +++ CoyoteAdapter.java	4 Oct 2004 09:25:11 -0000	1.6
  @@ -135,7 +135,7 @@
   
           }
   
  -        if (connector.isXpoweredBy()) {
  +        if (connector.getXpoweredBy()) {
               response.addHeader("X-Powered-By", "Servlet/2.4");
           }
   
  
  
  

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


Mime
View raw message