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();
|
}
|
|
}
|
|
|
}
|