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;
021
022 import java.util.EventListener;
023
024 /**
025 * A ServletRequestListener can be implemented by the developer
026 * interested in being notified of requests coming in and out of
027 * scope in a web component. A request is defined as coming into
028 * scope when it is about to enter the first servlet or filter
029 * in each web application, as going out of scope when it exits
030 * the last servlet or the first filter in the chain.
031 *
032 * @since Servlet 2.4
033 * @version $Rev: 788194 $ $Date: 2009-06-24 18:05:48 -0400 (Wed, 24 Jun 2009) $
034 */
035
036 public interface ServletRequestListener extends EventListener {
037
038 /**
039 * The request is about to go out of scope of the web application.
040 *
041 * @param sre event containing request
042 */
043 void requestDestroyed(ServletRequestEvent sre);
044
045 /**
046 * The request is about to come into scope of the web application.
047 *
048 * @param sre event containing request
049 */
050 void requestInitialized(ServletRequestEvent sre);
051
052 }