KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > ContainerEvent


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
18
19 package org.apache.catalina;
20
21
22 import java.util.EventObject JavaDoc;
23
24
25 /**
26  * General event for notifying listeners of significant changes on a Container.
27  *
28  * @author Craig R. McClanahan
29  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
30  */

31
32 public final class ContainerEvent
33     extends EventObject JavaDoc {
34
35
36     /**
37      * The Container on which this event occurred.
38      */

39     private Container container = null;
40
41
42     /**
43      * The event data associated with this event.
44      */

45     private Object JavaDoc data = null;
46
47
48     /**
49      * The event type this instance represents.
50      */

51     private String JavaDoc type = null;
52
53
54     /**
55      * Construct a new ContainerEvent with the specified parameters.
56      *
57      * @param container Container on which this event occurred
58      * @param type Event type
59      * @param data Event data
60      */

61     public ContainerEvent(Container container, String JavaDoc type, Object JavaDoc data) {
62
63         super(container);
64         this.container = container;
65         this.type = type;
66         this.data = data;
67
68     }
69
70
71     /**
72      * Return the event data of this event.
73      */

74     public Object JavaDoc getData() {
75
76         return (this.data);
77
78     }
79
80
81     /**
82      * Return the Container on which this event occurred.
83      */

84     public Container getContainer() {
85
86         return (this.container);
87
88     }
89
90
91     /**
92      * Return the event type of this event.
93      */

94     public String JavaDoc getType() {
95
96         return (this.type);
97
98     }
99
100
101     /**
102      * Return a string representation of this event.
103      */

104     public String JavaDoc toString() {
105
106         return ("ContainerEvent['" + getContainer() + "','" +
107                 getType() + "','" + getData() + "']");
108
109     }
110
111
112 }
113
Popular Tags