home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / Sambar Server.exe / _SETUP.1 / javaeng.jar / javax / servlet / http / HttpSessionBindingEvent.java < prev    next >
Encoding:
Java Source  |  2000-04-03  |  2.6 KB  |  88 lines

  1. /*
  2.  * HttpSessionBindingEvent.java -- Passed on to a HttpSessionBindingListener
  3.  *                                 whenever it is bound or unbound from a
  4.  *                                 HttpSession value
  5.  *
  6.  * Copyright (c) 1998 by Free Software Foundation, Inc.
  7.  * Written by Paul Siegmann (pauls@euronet.nl)
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU Library General Public License as published
  11.  * by the Free Software Foundation, version 2. (see COPYING.LIB)
  12.  *
  13.  * This program is distributed in the hope that it will be useful, but
  14.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software Foundation
  20.  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
  21.  */
  22.  
  23. package javax.servlet.http;
  24.  
  25. import java.util.EventObject;
  26.  
  27. /**
  28.  * Send to an Object that implements <code>HttpSessionBindingListener</code>
  29.  * when bound into a session or unbound from a session. Gives access to the
  30.  * session and the name used to bind the Object to the session.
  31.  *
  32.  * @see javax.servlet.http.HttpSession
  33.  * @see javax.servlet.http.HttpSession#putValue(java.lang.String, java.lang.Object)
  34.  * @see javax.servlet.http.HttpSession#removeValue(java.lang.String)
  35.  * @see javax.servlet.http.HttpSession#invalidate()
  36.  * @see javax.servlet.http.HttpSessionBindingListener
  37.  *
  38. #ifdef SERVLET_2_0
  39.  * @version Servlet API 2.0 
  40. #endif
  41. #ifdef SERVLET_2_1
  42.  * @version Servlet API 2.1
  43. #endif
  44. #ifdef SERVLET_2_2
  45.  * @version Servlet API 2.2
  46. #endif
  47.  * @since Servlet API 2.0
  48.  */
  49. public class HttpSessionBindingEvent
  50.     extends EventObject 
  51. {
  52.     private String myName;
  53.  
  54.     /**
  55.      * Creates a new <code>HttpSessionBindingEvent</code> given the session
  56.      * and the name used.
  57.      *
  58.      * @since Servlet API 2.0
  59.      *
  60.      * @param session which the Object was bound to or unbound from
  61.      * @param name which was used to refer to the object
  62.      */
  63.     public HttpSessionBindingEvent(HttpSession session, String name) {
  64.         super(session);
  65.         myName = name;
  66.     }
  67.  
  68.  
  69.     /**
  70.      * Returns the name used to refer to this Object.
  71.      *
  72.      * @since Servlet API 2.0
  73.      */
  74.     public String getName() {
  75.         return myName;
  76.     }
  77.  
  78.  
  79.     /**
  80.      * Returns the session the Object was bound to or unbound from.
  81.      *
  82.      * @since Servlet API 2.0
  83.      */
  84.     public HttpSession getSession() {
  85.         return (HttpSession)getSource();
  86.     }
  87. }
  88.