/*
 * @(#)SessionObject
 *
 * Copyright (c) 1998 Karl Moss. All Rights Reserved.
 *
 * You may study, use, modify, and distribute this software for any
 * purpose provided that this copyright notice appears in all copies.
 *
 * This software is provided WITHOUT WARRANTY either expressed or
 * implied.
 *
 * @author  Karl Moss
 * @version 1.0
 * @date    20Jan99
 *
 */

//package javaservlets.session;

import javax.servlet.*;
import javax.servlet.http.*;

/**
 * <p>This object demonstrates the use of the
 * HttpSessionBindingListener interface.
 */

public class SessionObject
  implements HttpSessionBindingListener
{

  /**
    * Called when this object is bound into a session.
    * @param event The event
    */
  public void valueBound(HttpSessionBindingEvent event)
    {
      // Output the fact that we are being bound
      System.out.println("" + (new java.util.Date()) +
                         " Binding " + event.getName() +
                         " to session " +
                         event.getSession().getId());
    }

  /**
    * Called when this object is unbound from a session
    * @param event The event
    */
  public void valueUnbound(HttpSessionBindingEvent event)
    {
      // Output the fact that we are being bound
      System.out.println("" + (new java.util.Date()) +
                         " Unbinding " + event.getName() +
                         " from session " +
                         event.getSession().getId());
    }

}
