01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.catalina;
19:
20: import java.util.EventObject;
21:
22: /**
23: * General event for notifying listeners of significant changes on a Session.
24: *
25: * @author Craig R. McClanahan
26: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
27: */
28:
29: public final class SessionEvent extends EventObject {
30:
31: /**
32: * The event data associated with this event.
33: */
34: private Object data = null;
35:
36: /**
37: * The Session on which this event occurred.
38: */
39: private Session session = null;
40:
41: /**
42: * The event type this instance represents.
43: */
44: private String type = null;
45:
46: /**
47: * Construct a new SessionEvent with the specified parameters.
48: *
49: * @param session Session on which this event occurred
50: * @param type Event type
51: * @param data Event data
52: */
53: public SessionEvent(Session session, String type, Object data) {
54:
55: super (session);
56: this .session = session;
57: this .type = type;
58: this .data = data;
59:
60: }
61:
62: /**
63: * Return the event data of this event.
64: */
65: public Object getData() {
66:
67: return (this .data);
68:
69: }
70:
71: /**
72: * Return the Session on which this event occurred.
73: */
74: public Session getSession() {
75:
76: return (this .session);
77:
78: }
79:
80: /**
81: * Return the event type of this event.
82: */
83: public String getType() {
84:
85: return (this .type);
86:
87: }
88:
89: /**
90: * Return a string representation of this event.
91: */
92: public String toString() {
93:
94: return ("SessionEvent['" + getSession() + "','" + getType() + "']");
95:
96: }
97:
98: }
|