// Copyright (c) 1999, 2000 Oracle Corporation
package oracle.jbo.html.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jbo.*;
import oracle.jbo.common.ampool.*;

import oracle.jbo.html.jsp.JSPApplicationRegistry;

public class SessionTimeOutHandler implements HttpSessionBindingListener
{
  String            poolName;
  ApplicationModule am = null;
  static PoolMgr poolManager = PoolMgr.getInstance();
  
  public SessionTimeOutHandler(String poolName , ApplicationModule am)
  {
    this.poolName = poolName;
    this.am = am;
  }

  public void valueBound(HttpSessionBindingEvent e)
  {
  }

  public void valueUnbound(HttpSessionBindingEvent e)
  {
    JSPApplicationRegistry.getInstance().releaseAppModuleInstance(
      poolName
      , e.getSession()
      , null
      , JSPApplicationRegistry.STATELESS);
      
    System.err.println("************* AM was released" + am.toString());
    
  }
  
}