portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r202098 - in /portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed: pipeline/valve/PageProfilerValve.java profiler/impl/ProfilerValveImpl.java
Date Mon, 27 Jun 2005 23:25:28 GMT
Author: taylor
Date: Mon Jun 27 16:25:28 2005
New Revision: 202098

URL: http://svn.apache.org/viewcvs?rev=202098&view=rev
Log:
optimize hits against profiler getRulesForPrincipal, since it was hitting the database once
per request

Modified:
    portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/pipeline/valve/PageProfilerValve.java
    portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java

Modified: portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/pipeline/valve/PageProfilerValve.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/pipeline/valve/PageProfilerValve.java?rev=202098&r1=202097&r2=202098&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/pipeline/valve/PageProfilerValve.java
(original)
+++ portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/pipeline/valve/PageProfilerValve.java
Mon Jun 27 16:25:28 2005
@@ -39,4 +39,5 @@
 public interface PageProfilerValve extends Valve
 {
     String PROFILE_LOCATOR_REQUEST_ATTR_KEY = "org.apache.jetspeed.profiler.ProfileLocator";
+    String PROFILE_LOCATORS_PER_PRINCIPAL = "org.apache.jetspeed.profiler.ProfileLocatorsPrincipal";
 }

Modified: portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java?rev=202098&r1=202097&r2=202098&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
(original)
+++ portals/jetspeed-2/trunk/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
Mon Jun 27 16:25:28 2005
@@ -100,8 +100,13 @@
             
             if ( locators ==  null )
             {
-                // get all locators for the current user
-                locators = profiler.getProfileLocators(request, principal);
+                locators = (Map)request.getSessionAttribute(PROFILE_LOCATORS_PER_PRINCIPAL);
+                if (locators == null)
+                {
+                    // get all locators for the current user
+                    locators = profiler.getProfileLocators(request, principal);
+                    request.setSessionAttribute(PROFILE_LOCATORS_PER_PRINCIPAL, locators);
+                }
             }
 
             if (locators.size() == 0)



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


Mime
View raw message