001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    package javax.servlet.http;
021    
022    import java.util.EventListener;
023    
024    /**
025     * Causes an object to be notified when it is bound to
026     * or unbound from a session. The object is notified
027     * by an {@link HttpSessionBindingEvent} object. This may be as a result
028     * of a servlet programmer explicitly unbinding an attribute from a session,
029     * due to a session being invalidated, or due to a session timing out.
030     *
031     * @version $Rev: 788194 $ $Date: 2009-06-24 18:05:48 -0400 (Wed, 24 Jun 2009) $
032     * @see HttpSession
033     * @see HttpSessionBindingEvent
034     */
035    public interface HttpSessionBindingListener extends EventListener {
036        /**
037         * Notifies the object that it is being bound to
038         * a session and identifies the session.
039         *
040         * @param event the event that identifies the
041         *              session
042         * @see #valueUnbound
043         */
044        void valueBound(HttpSessionBindingEvent event);
045    
046    
047        /**
048         * Notifies the object that it is being unbound
049         * from a session and identifies the session.
050         *
051         * @param event the event that identifies
052         *              the session
053         * @see #valueBound
054         */
055        void valueUnbound(HttpSessionBindingEvent event);
056    
057    }
058