Source code: com/opencms/core/OpenCmsServletNotify.java
1 /*
2 * File : $Source: /usr/local/cvs/opencms/src/com/opencms/core/OpenCmsServletNotify.java,v $
3 * Date : $Date: 2002/12/06 23:16:51 $
4 * Version: $Revision: 1.12 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */
28
29 package com.opencms.core;
30
31 import javax.servlet.http.HttpSessionBindingEvent;
32 import javax.servlet.http.HttpSessionBindingListener;
33
34 /**
35 * Implementation of the HttpSessionBindingListener interface. <br>
36 *
37 * The OpenCmsServletNotify Object is notified when it is bound or unbound to
38 * a HTTPSession. It is required to inform the OpemCms that a session is destroyed
39 * and must be removed from the CmsCoreSession storage.
40 *
41 * @author Michael Emmerich
42 * @version $Revision: 1.12 $ $Date: 2002/12/06 23:16:51 $
43 */
44 class OpenCmsServletNotify implements HttpSessionBindingListener {
45 String m_id = null;
46 CmsCoreSession m_sessionStorage = null;
47
48 /**
49 * Constructor, creates a new OpenCmsServletNotify object.
50 *
51 * @param id The session Id to which this object is bound to.
52 * @param sessionStorage The reference to the session strorage.
53 */
54 public OpenCmsServletNotify(String id, CmsCoreSession sessionStorage) {
55 m_id = id;
56 m_sessionStorage = sessionStorage;
57 }
58
59 /**
60 * Called when the listener is bound to a session.
61 *
62 * @param event The HttpSessionBindingEvent
63 */
64 public void valueBound(HttpSessionBindingEvent event) {
65
66
67 // nothing is required to be done here.
68 }
69
70 /**
71 * Called when the listener is unbound from to a session.
72 *
73 * @param event The HttpSessionBindingEvent
74 */
75 public void valueUnbound(HttpSessionBindingEvent event) {
76 m_sessionStorage.deleteUser(m_id);
77 }
78 }