01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.catalina;
18:
19: import java.util.EventObject;
20:
21: /**
22: * General event for notifying listeners of significant changes on a Container.
23: *
24: * @author Craig R. McClanahan
25: * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:38 $
26: */
27:
28: public final class ContainerEvent extends EventObject {
29:
30: /**
31: * The Container on which this event occurred.
32: */
33: private Container container = null;
34:
35: /**
36: * The event data associated with this event.
37: */
38: private Object data = null;
39:
40: /**
41: * The event type this instance represents.
42: */
43: private String type = null;
44:
45: /**
46: * Construct a new ContainerEvent with the specified parameters.
47: *
48: * @param container Container on which this event occurred
49: * @param type Event type
50: * @param data Event data
51: */
52: public ContainerEvent(Container container, String type, Object data) {
53:
54: super (container);
55: this .container = container;
56: this .type = type;
57: this .data = data;
58:
59: }
60:
61: /**
62: * Return the event data of this event.
63: */
64: public Object getData() {
65:
66: return (this .data);
67:
68: }
69:
70: /**
71: * Return the Container on which this event occurred.
72: */
73: public Container getContainer() {
74:
75: return (this .container);
76:
77: }
78:
79: /**
80: * Return the event type of this event.
81: */
82: public String getType() {
83:
84: return (this .type);
85:
86: }
87:
88: /**
89: * Return a string representation of this event.
90: */
91: public String toString() {
92:
93: return ("ContainerEvent['" + getContainer() + "','" + getType()
94: + "','" + getData() + "']");
95:
96: }
97:
98: }
|