portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r587803 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
Date Wed, 24 Oct 2007 07:24:12 GMT
Author: woonsan
Date: Wed Oct 24 00:23:58 2007
New Revision: 587803

URL: http://svn.apache.org/viewvc?rev=587803&view=rev
Log:
[JS2-785] Parallel Rendering on Websphere 6.1

My previous change on synchronization in InformationProviderServiceImpl was stupidly committed.
The real request instance provided by container such as SRTServletRequest instance must be
synchronized.
Synchronization on wrapper object is meaningful here.

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java?rev=587803&r1=587802&r2=587803&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
Wed Oct 24 00:23:58 2007
@@ -19,6 +19,9 @@
 import java.util.Map;
 
 import javax.servlet.ServletConfig;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.pluto.factory.Factory;
 import org.apache.pluto.services.information.DynamicInformationProvider;
@@ -54,7 +57,7 @@
         return staticInformationProvider;
     }
 
-    public DynamicInformationProvider getDynamicProvider(javax.servlet.http.HttpServletRequest
request)
+    public DynamicInformationProvider getDynamicProvider(HttpServletRequest request)
     {
         DynamicInformationProvider provider =
             (DynamicInformationProvider) request.getAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider");
@@ -65,9 +68,14 @@
             
             if (CurrentWorkerContext.getParallelRenderingMode())
             {
-                synchronized (request)
+                // request should be an instance of org.apache.jetspeed.engine.servlet.ServletRequestImpl
+                // unwrap the real request instance provided by the container to synchronize
+                
+                ServletRequest servletRequest = ((HttpServletRequestWrapper)((HttpServletRequestWrapper)
request).getRequest()).getRequest();
+
+                synchronized (servletRequest)
                 {
-                    request.setAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider",
provider);
+                    servletRequest.setAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider",
provider);
                 }
             }
             else



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