KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > servlet > ServletContextAttributeEvent


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */

17 package javax.servlet;
18
19
20     /**
21     * This is the event class for notifications about changes to the attributes of the
22     * servlet context of a web application.
23     * @see ServletContextAttributeListener
24      * @since v 2.3
25     */

26
27 public class ServletContextAttributeEvent extends ServletContextEvent JavaDoc {
28     private String JavaDoc name;
29     private Object JavaDoc value;
30
31     /** Construct a ServletContextAttributeEvent from the given context for the
32     ** given attribute name and attribute value.
33     */

34     public ServletContextAttributeEvent(ServletContext JavaDoc source, String JavaDoc name, Object JavaDoc value) {
35         super(source);
36         this.name = name;
37         this.value = value;
38     }
39     
40     /**
41     * Return the name of the attribute that changed on the ServletContext.
42     *
43     */

44     public String JavaDoc getName() {
45         return this.name;
46     }
47     
48     /**
49     * Returns the value of the attribute that has been added, removed, or replaced.
50     * If the attribute was added, this is the value of the attribute. If the attribute was
51     * removed, this is the value of the removed attribute. If the attribute was replaced, this
52     * is the old value of the attribute.
53     *
54     */

55     
56     public Object JavaDoc getValue() {
57         return this.value;
58     }
59 }
60
61
Popular Tags