portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r587813 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
Date Wed, 24 Oct 2007 08:20:40 GMT
Author: woonsan
Date: Wed Oct 24 01:20:39 2007
New Revision: 587813

URL: http://svn.apache.org/viewvc?rev=587813&view=rev
Log:
[JS2-785] Parallel Rendering on Websphere 6.1
Synchronization was added during invoking getAttribute().

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=587813&r1=587812&r2=587813&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 01:20:39 2007
@@ -59,20 +59,39 @@
 
     public DynamicInformationProvider getDynamicProvider(HttpServletRequest request)
     {
-        DynamicInformationProvider provider =
-            (DynamicInformationProvider) request.getAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider");
+        DynamicInformationProvider provider = null;
+        
+        boolean isParallel = CurrentWorkerContext.getParallelRenderingMode();
+        ServletRequest servletRequest = null;
+        
+        if (isParallel)
+        {
+            // request should be an instance of org.apache.jetspeed.engine.servlet.ServletRequestImpl
+            // unwrap the real request instance provided by the container to synchronize
+            servletRequest = ((HttpServletRequestWrapper) request).getRequest();
+
+            // if it is not an instance of HttpServletRequestWrapper any more, then it is
not AdjustedSRTServletRequest instance.
+            if (servletRequest instanceof HttpServletRequestWrapper)
+            {
+                servletRequest = ((HttpServletRequestWrapper) servletRequest).getRequest();
+            }
+            
+            synchronized (servletRequest)
+            {
+                provider = (DynamicInformationProvider) servletRequest.getAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider");
+            }
+        }
+        else
+        {
+            provider = (DynamicInformationProvider) request.getAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider");
+        }
 
         if (provider == null)
         {
             provider = new DynamicInformationProviderImpl(request, servletConfig);
             
-            if (CurrentWorkerContext.getParallelRenderingMode())
+            if (isParallel)
             {
-                // 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)
                 {
                     servletRequest.setAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider",
provider);



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