package wenrgise.common.utility;

import java.rmi.RemoteException;
import javax.ejb.RemoveException;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import wenrgise.ejb.common.session.UserSession;

public class EnrgiseListener implements HttpSessionListener {
  public void sessionCreated(HttpSessionEvent sEvent) {}
  
  public void sessionDestroyed(HttpSessionEvent sEvent) {
    try {
      HttpSession session = sEvent.getSession();
      if (session != null) {
        UserSession oUser = (UserSession)session.getAttribute(ParamUtil.getSessionBeanName());
        oUser.remove();
      } 
    } catch (RemoveException removeException) {
    
    } catch (RemoteException remoteException) {}
  }
}
