fs-danaus
2023-07-10 4849078e3450b8d3b3030a658a34dd58b0630fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.yc.listener;
 
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
 
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
 
import com.yc.action.mail.service.OtherMailIfc;
import com.yc.factory.FactoryBean;
import com.yc.license.InitLicense;
import com.yc.multiData.SpObserver;
import com.yc.service.user.UserAccountServiceIfc;
import com.yc.utils.SessionKey;
 
/**
 * 监听session 创建 与 销毁(统计在线用户)
 * @author heqing.hbs@gmail.com
 * @updatedBy
 * @updateTime 2011-9-1 下午04:41:57
 */
@SuppressWarnings("all")
public class OnLineUser implements HttpSessionBindingListener,Serializable{
    private static final long serialVersionUID=762508508425179227l;
 
 
    @Override
    public void valueBound(HttpSessionBindingEvent event) {
        String name = event.getName() ;
        Object value = event.getValue() ;
 
        if (name != null && SessionKey.DATA_BASE_ID.equals(name) && value != null && !"".equals(value)) {
          InitLicense.getInstance().addSessionCount();//给加密狗用,作为单个客户计数使用
        }
    }
 
    @Override
    public void valueUnbound(HttpSessionBindingEvent event) {
        String name = event.getName() ;
        Object value = event.getValue() ;
 
        if (name != null && SessionKey.DATA_BASE_ID.equals(name) && value != null && !"".equals(value)) {
            InitLicense.getInstance().pusSessionCount();
        }
        
    }
 
    
}