bloritsch    01/10/25 13:36:25

  Modified:    src/org/apache/cocoon/matching Tag: cocoon_20_branch
                        BrowserMatcherFactory.java
                        WildcardHeaderMatcherFactory.java
                        WildcardParameterValueMatcherFactory.java
                        WildcardSessionAttributeMatcherFactory.java
                        WildcardURIMatcherFactory.java
               src/org/apache/cocoon/selection Tag: cocoon_20_branch
                        HeaderSelectorFactory.java
                        RequestSelectorFactory.java
                        SessionAttributeSelectorFactory.java
               src/org/apache/cocoon/sitemap Tag: cocoon_20_branch
                        Handler.java
               src/org/apache/cocoon/util Tag: cocoon_20_branch
                        PostInputStream.java
  Log:
  Optimize critical path
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.6 +3 -2      
xml-cocoon2/src/org/apache/cocoon/matching/BrowserMatcherFactory.java
  
  Index: BrowserMatcherFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/BrowserMatcherFactory.java,v
  retrieving revision 1.1.1.1.2.5
  retrieving revision 1.1.1.1.2.6
  diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6
  --- BrowserMatcherFactory.java        2001/10/11 08:56:13     1.1.1.1.2.5
  +++ BrowserMatcherFactory.java        2001/10/25 20:36:24     1.1.1.1.2.6
  @@ -19,7 +19,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.1.1.2.5 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.1.1.1.2.6 $ $Date: 2001/10/25 20:36:24 $
    */
   
   public class BrowserMatcherFactory implements CodeFactory {
  @@ -59,7 +59,8 @@
       public String generateClassSource (String prefix, String pattern,
                                          NodeList conf)
       throws ConfigurationException {
  -        return "\n// Dummy values\nstatic String " + prefix + "_expr = \"" + 
pattern + "\";\n";
  +        return new StringBuffer("\n// Dummy values\nstatic String ")
  +                .append(prefix).append("_expr = 
\"").append(pattern).append("\";\n").toString();
       }
   
       public String generateParameterSource (NodeList conf)
  
  
  
  1.1.2.8   +3 -3      
xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcherFactory.java
  
  Index: WildcardHeaderMatcherFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcherFactory.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- WildcardHeaderMatcherFactory.java 2001/10/11 08:56:13     1.1.2.7
  +++ WildcardHeaderMatcherFactory.java 2001/10/25 20:36:24     1.1.2.8
  @@ -22,7 +22,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
    */
   
   public class WildcardHeaderMatcherFactory extends WildcardURIMatcherFactory {
  @@ -67,13 +67,13 @@
                .append("  }");
        } else {
            sb
  -             .append("  parameterName = \""+parameterName+"\";")
  +             .append("  parameterName = \"").append(parameterName).append("\";")
                .append("  parameterValue = XSPRequestHelper.getHeader(objectModel, 
parameterName);")
                .append("} else { ")
                .append("  parameterName = parameters.getParameter(\"parameter-name\", 
null);")
                .append("  if ( parameterName == null ) {")
                .append("     getLogger().warn(\"No request header name given, will 
use default\");")
  -             .append("     parameterName = \""+parameterName+"\";")
  +             .append("     parameterName = \"").append(parameterName).append("\";")
                .append("  }")
                .append("  parameterValue = XSPRequestHelper.getHeader(objectModel, 
parameterName); ");
        }
  
  
  
  1.1.2.8   +3 -3      
xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcherFactory.java
  
  Index: WildcardParameterValueMatcherFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcherFactory.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- WildcardParameterValueMatcherFactory.java 2001/10/11 08:56:13     1.1.2.7
  +++ WildcardParameterValueMatcherFactory.java 2001/10/25 20:36:24     1.1.2.8
  @@ -26,7 +26,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/10/11 08:56:13 $ */
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $ */
   
   public class WildcardParameterValueMatcherFactory extends WildcardURIMatcherFactory 
{
   
  @@ -70,13 +70,13 @@
                .append("  }");
        } else {
            sb
  -             .append("  parameterName = \""+parameterName+"\";")
  +             .append("  parameterName = \"").append(parameterName).append("\";")
                .append("  parameterValue = XSPRequestHelper.getParameter(objectModel, 
parameterName, null);")
                .append("} else { ")
                .append("  parameterName = parameters.getParameter(\"parameter-name\", 
null);")
                .append("  if ( parameterName == null ) {")
                .append("     getLogger().warn(\"No request parameter name given, will 
use default\");")
  -             .append("     parameterName = \""+parameterName+"\";")
  +             .append("     parameterName = \"").append(parameterName).append("\";")
                .append("  }")
                .append("  parameterValue = XSPRequestHelper.getParameter(objectModel, 
parameterName, null); ");
        }
  
  
  
  1.1.2.5   +3 -3      
xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcherFactory.java
  
  Index: WildcardSessionAttributeMatcherFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcherFactory.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- WildcardSessionAttributeMatcherFactory.java       2001/10/11 08:56:13     1.1.2.4
  +++ WildcardSessionAttributeMatcherFactory.java       2001/10/25 20:36:24     1.1.2.5
  @@ -21,7 +21,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/10/25 20:36:24 $
    */
   
   public class WildcardSessionAttributeMatcherFactory extends 
WildcardURIMatcherFactory {
  @@ -66,13 +66,13 @@
                .append("  }");
        } else {
            sb
  -             .append("  attributeName = \""+attributeName+"\";")
  +             .append("  attributeName = \"").append(attributeName).append("\";")
                .append("  attributeValue = (String) 
XSPRequestHelper.getSessionAttribute(objectModel, attributeName);")
                .append("} else { ")
                .append("  attributeName = parameters.getParameter(\"attribute-name\", 
null);")
                .append("  if ( attributeName == null ) {")
                .append("     getLogger().warn(\"No session attribute given, will use 
default\");")
  -             .append("     attributeName = \""+attributeName+"\";")
  +             .append("     attributeName = \"").append(attributeName).append("\";")
                .append("  }")
                .append("  attributeValue = (String) 
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ");
        }
  
  
  
  1.2.2.3   +7 -8      
xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcherFactory.java
  
  Index: WildcardURIMatcherFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcherFactory.java,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- WildcardURIMatcherFactory.java    2001/10/11 08:56:13     1.2.2.2
  +++ WildcardURIMatcherFactory.java    2001/10/25 20:36:24     1.2.2.3
  @@ -19,7 +19,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
  - * @version CVS $Revision: 1.2.2.2 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.2.2.3 $ $Date: 2001/10/25 20:36:24 $
    */
   
   public class WildcardURIMatcherFactory extends AbstractLoggable implements 
CodeFactory {
  @@ -51,13 +51,12 @@
        */
       public String generateMethodSource (NodeList conf)
       throws ConfigurationException {
  -        return "HashMap map = new HashMap();" +
  -               "String uri = XSPRequestHelper.getSitemapURI(objectModel);" +
  -               "if (uri.startsWith(\"/\")) uri = uri.substring(1);" +
  -               "if (org.apache.cocoon.matching.helpers.WildcardURIMatcher.match 
(map, uri, pattern)) {" +
  -               "return map;" +
  -               "} else {" +
  -               "return null;}";
  +        return new StringBuffer("HashMap map = new HashMap();")
  +                .append("String uri = XSPRequestHelper.getSitemapURI(objectModel);")
  +                .append("if (uri.startsWith(\"/\")) uri = uri.substring(1);")
  +                .append("if 
(org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (map, uri, pattern)) {")
  +                .append("return map;").append("} else {")
  +                .append("return null;}").toString();
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +3 -3      
xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelectorFactory.java
  
  Index: HeaderSelectorFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelectorFactory.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- HeaderSelectorFactory.java        2001/10/11 08:56:13     1.1.2.7
  +++ HeaderSelectorFactory.java        2001/10/25 20:36:24     1.1.2.8
  @@ -22,7 +22,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
    */
   public class HeaderSelectorFactory extends ParameterSelectorFactory {
   
  @@ -61,12 +61,12 @@
                .append("  }");
        } else {
            sb
  -             .append("  compareToString = (String) 
XSPRequestHelper.getHeader(objectModel, \""+parameterName+"\");")
  +             .append("  compareToString = (String) 
XSPRequestHelper.getHeader(objectModel, \"").append(parameterName).append("\");")
                .append("} else { ")
                .append("  String parameterName = 
param.getParameter(\"parameter-name\", null);")
                .append("  if ( parameterName == null ) {")
                .append("     getLogger().warn(\"No request header name given, will 
use default\");")
  -             .append("     parameterName = \""+parameterName+"\";")
  +             .append("     parameterName = \"").append(parameterName).append("\";")
                .append("  }")
                .append("  compareToString = (String) 
XSPRequestHelper.getHeader(objectModel, parameterName);");
        }
  
  
  
  1.1.2.8   +3 -3      
xml-cocoon2/src/org/apache/cocoon/selection/RequestSelectorFactory.java
  
  Index: RequestSelectorFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/RequestSelectorFactory.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- RequestSelectorFactory.java       2001/10/11 08:56:13     1.1.2.7
  +++ RequestSelectorFactory.java       2001/10/25 20:36:24     1.1.2.8
  @@ -22,7 +22,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/10/11 08:56:13 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
    */
   public class RequestSelectorFactory extends ParameterSelectorFactory {
   
  @@ -61,12 +61,12 @@
                .append("  }");
        } else {
            sb
  -             .append("  compareToString = (String) 
XSPRequestHelper.getParameter(objectModel, \""+parameterName+"\", null);")
  +             .append("  compareToString = (String) 
XSPRequestHelper.getParameter(objectModel, \"").append(parameterName).append("\", 
null);")
                .append("} else { ")
                .append("  String parameterName = 
param.getParameter(\"parameter-name\", null);")
                .append("  if ( parameterName == null ) {")
                .append("     getLogger().warn(\"No request parameter name given, will 
use default\");")
  -             .append("     parameterName = \""+parameterName+"\";")
  +             .append("     parameterName = \"").append(parameterName).append("\";")
                .append("  }")
                .append("  compareToString = (String) 
XSPRequestHelper.getParameter(objectModel, parameterName, null);");
        }
  
  
  
  1.1.2.6   +3 -3      
xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelectorFactory.java
  
  Index: SessionAttributeSelectorFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelectorFactory.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- SessionAttributeSelectorFactory.java      2001/10/11 08:56:14     1.1.2.5
  +++ SessionAttributeSelectorFactory.java      2001/10/25 20:36:24     1.1.2.6
  @@ -21,7 +21,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/10/11 08:56:14 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/10/25 20:36:24 $
    */
   public class SessionAttributeSelectorFactory extends ParameterSelectorFactory {
   
  @@ -60,12 +60,12 @@
                .append("  }");
        } else {
            sb
  -             .append("  compareToString = (String) 
XSPRequestHelper.getSessionAttribute(objectModel, \""+attributeName+"\");")
  +             .append("  compareToString = (String) 
XSPRequestHelper.getSessionAttribute(objectModel, 
\"").append(attributeName).append("\");")
                .append("} else { ")
                .append("  String attributeName = 
param.getParameter(\"attribute-name\", null);")
                .append("  if ( attributeName == null ) {")
                .append("     getLogger().warn(\"No session attribute given, will use 
default\");")
  -             .append("     attributeName = \""+attributeName+"\";")
  +             .append("     attributeName = \"").append(attributeName).append("\";")
                .append("  }")
                .append("  compareToString = (String) 
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ");
        }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.17  +3 -2      xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java,v
  retrieving revision 1.9.2.16
  retrieving revision 1.9.2.17
  diff -u -r1.9.2.16 -r1.9.2.17
  --- Handler.java      2001/10/17 10:05:53     1.9.2.16
  +++ Handler.java      2001/10/25 20:36:24     1.9.2.17
  @@ -41,7 +41,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.9.2.16 $ $Date: 2001/10/17 10:05:53 $
  + * @version CVS $Revision: 1.9.2.17 $ $Date: 2001/10/25 20:36:24 $
    */
   public class Handler extends AbstractLoggable
   implements Runnable, Contextualizable, Composable, Processor, Disposable, 
SourceResolver {
  @@ -274,7 +274,8 @@
           if (systemId.indexOf(":") > 1)
               return this.sourceHandler.getSource(null, systemId);
           if (systemId.charAt(0) == '/')
  -            return this.sourceHandler.getSource(null, context.getProtocol() + ":" + 
systemId);
  +            return this.sourceHandler.getSource(null, new 
StringBuffer(context.getProtocol())
  +                                                
.append(":").append(systemId).toString());
           return this.sourceHandler.getSource(null, context, systemId);
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +6 -2      xml-cocoon2/src/org/apache/cocoon/util/PostInputStream.java
  
  Index: PostInputStream.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/PostInputStream.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- PostInputStream.java      2001/10/23 12:04:14     1.1.2.5
  +++ PostInputStream.java      2001/10/25 20:36:24     1.1.2.6
  @@ -14,7 +14,7 @@
    * It allows to control read operation, restricting the number of bytes read to the 
value returned by getContentLen() method.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Kinga Dziembowski</a>
  - * @version $Id: PostInputStream.java,v 1.1.2.5 2001/10/23 12:04:14 cziegeler Exp $
  + * @version $Id: PostInputStream.java,v 1.1.2.6 2001/10/25 20:36:24 bloritsch Exp $
    */
   
   public class PostInputStream extends InputStream {
  @@ -246,6 +246,10 @@
       * @return string the String representation of this.
       */
       public String toString() {
  -        return getClass().getName() + "[inputStream=" + m_inputStream + ",  
contentLen=" + m_contentLen + "bytesRead=" + m_bytesRead + "]";
  +        return new StringBuffer(getClass().getName())
  +                .append("[inputStream=").append(m_inputStream)
  +                .append(",  contentLen=").append(m_contentLen)
  +                .append("bytesRead=").append(m_bytesRead)
  +                .append("]").toString();
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to