01: /*
02: * Copyright 1999-2001,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 Session.
23: *
24: * @author Craig R. McClanahan
25: * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:39 $
26: */
27:
28: public final class SessionEvent extends EventObject {
29:
30: /**
31: * The event data associated with this event.
32: */
33: private Object data = null;
34:
35: /**
36: * The Session on which this event occurred.
37: */
38: private Session session = null;
39:
40: /**
41: * The event type this instance represents.
42: */
43: private String type = null;
44:
45: /**
46: * Construct a new SessionEvent with the specified parameters.
47: *
48: * @param session Session on which this event occurred
49: * @param type Event type
50: * @param data Event data
51: */
52: public SessionEvent(Session session, String type, Object data) {
53:
54: super (session);
55: this .session = session;
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 Session on which this event occurred.
72: */
73: public Session getSession() {
74:
75: return (this .session);
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 ("SessionEvent['" + getSession() + "','" + getType() + "']");
94:
95: }
96:
97: }
|