portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r447950 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
Date Tue, 19 Sep 2006 20:24:24 GMT
Author: ate
Date: Tue Sep 19 13:24:24 2006
New Revision: 447950

URL: http://svn.apache.org/viewvc?view=rev&rev=447950
Log:
A hopefully stronger handling of the NPE situation David Taylor encountered (see previous
change) in the checkMonitorSession method.

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java?view=diff&rev=447950&r1=447949&r2=447950
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
Tue Sep 19 13:24:24 2006
@@ -132,8 +132,25 @@
             PortalSessionRegistry psr = (PortalSessionRegistry)portalSessionsRegistry.get(portalSession.getId());
             if (psr == null)
             {
-                psr = new PortalSessionRegistry();
-                portalSessionsRegistry.put(portalSession.getId(), psr);
+                // yet unexplained condition: the HttpSessionListener on the portal application
*should* have registered the session!!!
+                // Alas, it has been reported to happen...
+                // Now trying to do some recovering here
+                PortalSessionMonitor psm = (PortalSessionMonitor)portalSession.getAttribute(PortalSessionMonitor.SESSION_KEY);
+                // the psm better be null here, otherwise something really is corrupt or
not playing by the listeners contracts
+                if ( psm == null )
+                {
+                    portalSessionCreated(portalSession);
+                }
+                else
+                {
+                    // Now we have discovered a really strange situation here
+                    // Only explanation I can see is that a passivation of the portalSession
occurred, 
+                    // but that the activation again didn't trigger the sessionDidActivate
event handler???
+                   // Lets just try to accomodate this situation for now:
+                    portalSessionDidActivate(psm);
+                }
+                // now retrieve the just created psr again
+                psr = (PortalSessionRegistry)portalSessionsRegistry.get(portalSession.getId());
             }
             PortletApplicationSessionMonitor pasm = (PortletApplicationSessionMonitor)psr.sessionMonitors.get(contextPath);
             if ( pasm != null )



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