Author: phuong_vu
Date: 2011-01-12 21:21:57 -0500 (Wed, 12 Jan 2011)
New Revision: 5738
Modified:
portal/branches/branch-GTNPORTAL-1745/examples/portal/war/src/main/webapp/WEB-INF/web.xml
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/web.xml
portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/application/PortalSessionListener.java
Log:
GTNPORTAL-1744 Deprecate PortalSessionListener which is useless now and leave it empty for
compatibility with older versions
Modified:
portal/branches/branch-GTNPORTAL-1745/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
---
portal/branches/branch-GTNPORTAL-1745/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2011-01-12
20:43:59 UTC (rev 5737)
+++
portal/branches/branch-GTNPORTAL-1745/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2011-01-13
02:21:57 UTC (rev 5738)
@@ -141,9 +141,6 @@
<listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
</listener>
<listener>
- <listener-class>org.exoplatform.portal.application.PortalSessionListener</listener-class>
- </listener>
- <listener>
<listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
</listener>
<!-- ================================================================== -->
Modified:
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
---
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/web.xml 2011-01-12
20:43:59 UTC (rev 5737)
+++
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/web.xml 2011-01-13
02:21:57 UTC (rev 5738)
@@ -182,9 +182,6 @@
<listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
</listener>
<listener>
-
<listener-class>org.exoplatform.portal.application.PortalSessionListener</listener-class>
- </listener>
- <listener>
<listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
</listener>
<!-- ================================================================== -->
Modified:
portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/application/PortalSessionListener.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/application/PortalSessionListener.java 2011-01-12
20:43:59 UTC (rev 5737)
+++
portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/application/PortalSessionListener.java 2011-01-13
02:21:57 UTC (rev 5738)
@@ -19,31 +19,36 @@
package org.exoplatform.portal.application;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.web.AbstractHttpSessionListener;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.web.WebAppController;
import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
/**
+ * This session listener was created for purpose of expiring the portal session stored in
the StateManager
+ * and removes the WindowInfos object from the WindowInfosContainer container
+ * <p>
* Created by The eXo Platform SAS
* Date: Jan 25, 2003
* Time: 5:25:52 PM
+ *
+ * @deprecated Currently we do not store anything outside of the session,
+ * that's why we do not need to clean anything when a session is destroyed.
*/
-public class PortalSessionListener extends AbstractHttpSessionListener
+@Deprecated
+public class PortalSessionListener implements HttpSessionListener
{
- protected static Log log =
ExoLogger.getLogger("portal:PortalSessionListener");
+ protected static Log log =
ExoLogger.getLogger("portal.PortalSessionListener");
public PortalSessionListener()
{
+ log.debug("This session listener is not useful anymore and it is left empty
for now to be compatible with older versions");
}
@Override
- protected void onSessionDestroyed(ExoContainer container, HttpSessionEvent event)
+ public void sessionCreated(HttpSessionEvent se)
{
}
@@ -63,29 +68,7 @@
*
*/
@Override
- protected void onSessionCreated(ExoContainer container, HttpSessionEvent event)
+ public void sessionDestroyed(HttpSessionEvent se)
{
- try
- {
- if (log.isInfoEnabled())
- log.info("Destroy session from '" + container == null ?
"unknown" : ((PortalContainer)container).getName()
- + "' portal");
- WebAppController controller =
(WebAppController)container.getComponentInstanceOfType(WebAppController.class);
- PortalApplication portalApp =
controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID);
- portalApp.getStateManager().expire(event.getSession().getId(), portalApp);
- }
- catch (Exception ex)
- {
- log.error("Error while destroying a portal session", ex);
- }
}
-
- /**
- * @see
org.exoplatform.container.web.AbstractHttpSessionListener#requirePortalEnvironment()
- */
- @Override
- protected boolean requirePortalEnvironment()
- {
- return true;
- }
}