[gatein-commits] gatein SVN: r2025 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer.

do-not-reply at jboss.org do-not-reply at jboss.org
Sun Mar 7 17:12:47 EST 2010


Author: chris.laprun at jboss.com
Date: 2010-03-07 17:12:46 -0500 (Sun, 07 Mar 2010)
New Revision: 2025

Modified:
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java
Log:
- No need to create a new ResourceURLRewriter per request as it's stateless and made the class package-local as tests are now in the package.

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java	2010-03-07 22:09:00 UTC (rev 2024)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java	2010-03-07 22:12:46 UTC (rev 2025)
@@ -1,6 +1,6 @@
 /*
  * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
  * contributors as indicated by the @authors tag. See the
  * copyright.txt in the distribution for a full listing of
  * individual contributors.
@@ -65,6 +65,7 @@
    private static final String SEPARATOR = "_";
 
    private static final org.gatein.pc.api.cache.CacheControl DEFAULT_CACHE_CONTROL = new org.gatein.pc.api.cache.CacheControl(0, CacheScope.PRIVATE, null);
+   private static final ResourceURLRewriter RESOURCE_REWRITER = new ResourceURLRewriter();
 
    public RenderHandler(WSRPConsumerImpl consumer)
    {
@@ -198,8 +199,7 @@
       }
 
       // means that the producer generated the URLs, so handle resources...
-      ResourceURLRewriter rewriter = new ResourceURLRewriter();
-      return URLTools.replaceURLsBy(markup, rewriter);
+      return URLTools.replaceURLsBy(markup, RESOURCE_REWRITER);
    }
 
    private org.gatein.pc.api.cache.CacheControl createCacheControl(MarkupContext markupContext)
@@ -279,8 +279,7 @@
       }
    }
 
-   // @todo: public for tests
-   public static class ResourceURLRewriter extends URLTools.URLReplacementGenerator
+   static class ResourceURLRewriter extends URLTools.URLReplacementGenerator
    {
       public String getReplacementFor(int currentIndex, URLTools.URLMatch currentMatch)
       {



More information about the gatein-commits mailing list