1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20 package javax.servlet; 21 22 import java.util.EventListener; 23 24 /** 25 * A ServletRequestListener can be implemented by the developer 26 * interested in being notified of requests coming in and out of 27 * scope in a web component. A request is defined as coming into 28 * scope when it is about to enter the first servlet or filter 29 * in each web application, as going out of scope when it exits 30 * the last servlet or the first filter in the chain. 31 * 32 * @since Servlet 2.4 33 */ 34 35 36 public interface ServletRequestListener extends EventListener { 37 38 /** The request is about to go out of scope of the web application. */ 39 public void requestDestroyed ( ServletRequestEvent sre ); 40 41 /** The request is about to come into scope of the web application. */ 42 public void requestInitialized ( ServletRequestEvent sre ); 43 44 /** 45 * A request has been suspended. 46 * Called by the thread that dispatched the servlet when it 47 * has returned to the container. 48 * @since 3.0 49 */ 50 void requestSuspended(ServletRequestEvent rre); 51 52 /** 53 * A request has been resumed. 54 * Called by the thread that will dispatch to the servlet 55 * immediately before dispatch. 56 * @since 3.0 57 */ 58 void requestResumed(ServletRequestEvent rre); 59 60 /** 61 * A request has been completed. 62 * Called from a call to {@ServletRequest#complete()} 63 * @since 3.0 64 */ 65 void requestCompleted(ServletRequestEvent rre); 66 }