001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.hayabusa.common;
017
018 import javax.servlet.http.HttpSession ;
019 import javax.servlet.http.HttpSessionListener;
020 import javax.servlet.http.HttpSessionEvent;
021
022 /**
023 * HttpSessionListener を実è£?�—たã?セãƒ?‚·ョン状態ã?監視リスナã?クラスですã?
024 * これは、セãƒ?‚·ョンの作æ?/破æ£?‚’監視できますã?
025 * こã?リスナã?は、WEB-INF/web.xml で、çµ?�¿込みますã?
026 *
027 * 【WEB-INF/web.xmlã€?
028 *
029 * <listener>
030 * <listener-class>
031 * org.opengion.hayabusa.common.HybsSessionListener
032 * </listener-class>
033 * </listener>
034 *
035 * @og.group ログイン制御
036 *
037 * @version 4.0
038 * @author Kazuhiko Hasegawa
039 * @since JDK5.0,
040 */
041 public class HybsSessionListener implements HttpSessionListener {
042
043 /**
044 * HttpSessionListener インターフェースの実è£?
045 *
046 * セãƒ?‚·ョンが作æ?されたときにリスナã?に通知されるã?
047 * 現段階では、なにもしなã�??
048 *
049 * @param event セãƒ?‚·ョンイベンãƒ?
050 */
051 @Override
052 public void sessionCreated( final HttpSessionEvent event ) {
053 // taglib\HeadTag.java に移å‹?
054 // HttpSession session = event.getSession();
055 // SystemManager.addSession( session );
056 }
057
058 /**
059 * HttpSessionListener インターフェースの実è£?
060 *
061 * セãƒ?‚·ョンがç?æ£?�•れたときにリスナã?に通知されるã?
062 *
063 * @og.rev 5.5.9.1 (2012/12/07) SystemManager に渡すã?は、sessionID ではなくã?session オブジェクトとするã€?
064 *
065 * @param event セãƒ?‚·ョンイベンãƒ?
066 */
067 @Override
068 public void sessionDestroyed( final HttpSessionEvent event ) {
069 HttpSession session = event.getSession();
070 // String sessionID = session.getId();
071 // SystemManager.removeSession( sessionID );
072 SystemManager.removeSession( session ); // 5.5.9.1 (2012/12/07)
073 }
074 }