2 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the
8 // "Software"), to deal in the Software without restriction, including
9 // without limitation the rights to use, copy, modify, merge, publish,
10 // distribute, sublicense, and/or sell copies of the Software, and to
11 // permit persons to whom the Software is furnished to do so, subject to
12 // the following conditions:
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the Software.
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 using System.Web.SessionState;
28 using System.Reflection;
29 using javax.servlet.http;
30 using Mainsoft.Web.Hosting;
31 using System.Diagnostics;
33 namespace Mainsoft.Web.SessionState
36 /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
38 public class SessionListener : javax.servlet.http.HttpSessionListener
41 public void sessionCreated (HttpSessionEvent se) {
44 public void sessionDestroyed (HttpSessionEvent se) {
45 bool setDomain = vmw.@internal.EnvironmentUtils.getAppDomain () == null;
47 AppDomain servletDomain = (AppDomain) se.getSession ().getServletContext ().getAttribute (J2EEConsts.APP_DOMAIN);
48 if (servletDomain == null)
50 vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
53 HttpSessionStateContainer container =
54 ServletSessionStateStoreProvider.CreateContainer (se.getSession ());
56 SessionStateUtility.RaiseSessionEnd (container, this, EventArgs.Empty);
59 Debug.WriteLine (e.Message);
60 Debug.WriteLine (e.StackTrace);
64 vmw.@internal.EnvironmentUtils.clearAppDomain ();
71 namespace System.Web.GH
74 /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
76 public class SessionListener : Mainsoft.Web.SessionState.SessionListener
81 namespace System.Web.J2EE
84 /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
86 public class SessionListener : Mainsoft.Web.SessionState.SessionListener