portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r380761 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed: aggregator/impl/PortletRendererImpl.java engine/JetspeedEngine.java security/impl/SecurityValveImpl.java
Date Fri, 24 Feb 2006 18:14:22 GMT
Author: taylor
Date: Fri Feb 24 10:14:19 2006
New Revision: 380761

URL: http://svn.apache.org/viewcvs?rev=380761&view=rev
Log:
ease the disabling of Statistics component
Really, the Statistics component would be best implemented as an aspect

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java?rev=380761&r1=380760&r2=380761&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
Fri Feb 24 10:14:19 2006
@@ -73,6 +73,16 @@
         this.statistics = statistics;
     }
 
+    public PortletRendererImpl(PortletContainer container, 
+            PortletWindowAccessor windowAccessor,
+            WorkerMonitor workMonitor)
+    {
+        this.container = container;
+        this.windowAccessor = windowAccessor;
+        this.workMonitor = workMonitor;
+        this.statistics = null;
+    }
+    
     public void start()
     {
         // workMonitor.start();

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java?rev=380761&r1=380760&r2=380761&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
Fri Feb 24 10:14:19 2006
@@ -139,7 +139,15 @@
             //Start the ComponentManager
             componentManager.start();               
             pipelineMapper = (Map)componentManager.getComponent("pipeline-map");
-            statistics = (PortalStatistics)componentManager.getComponent("PortalStatistics");
+            try
+            {
+                statistics = (PortalStatistics)componentManager.getComponent("PortalStatistics");
+            }
+            catch (Exception e)
+            {
+                // silenty ignore, its not configured
+                // TODO: statistics as an AOP advice
+            }
             
         }
         catch (Throwable e)
@@ -231,7 +239,8 @@
         pipeline.invoke(context);
    
         long end = System.currentTimeMillis();
-        statistics.logPageAccess(context, PortalStatistics.HTTP_OK, end - start);
+        if (statistics != null)
+            statistics.logPageAccess(context, PortalStatistics.HTTP_OK, end - start);
     }
 
     /**

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java?rev=380761&r1=380760&r2=380761&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
Fri Feb 24 10:14:19 2006
@@ -56,6 +56,13 @@
         this.statistics = statistics;
     }
 
+    public SecurityValveImpl(Profiler profiler, UserManager userMgr)
+    {
+        this.profiler = profiler;
+        this.userMgr = userMgr;
+        this.statistics = null;
+    }
+    
     public String toString()
     {
         return "SecurityValve";
@@ -116,7 +123,10 @@
             } 
             
             // create a new statistics *user* session
-            statistics.logUserLogin(request, 0);
+            if (statistics != null)
+            {
+                statistics.logUserLogin(request, 0);
+            }
             // put IP address in session for logout
             request.setSessionAttribute(IP_ADDRESS, request.getRequest().getRemoteAddr());
         }



---------------------------------------------------------------------
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