KickJava   Java API By Example, From Geeks To Geeks.

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


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 Session.
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 SessionEvent
33     extends EventObject JavaDoc {
34
35
36     /**
37      * The event data associated with this event.
38      */

39     private Object JavaDoc data = null;
40
41
42     /**
43      * The Session on which this event occurred.
44      */

45     private Session session = 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 SessionEvent with the specified parameters.
56      *
57      * @param session Session on which this event occurred
58      * @param type Event type
59      * @param data Event data
60      */

61     public SessionEvent(Session session, String JavaDoc type, Object JavaDoc data) {
62
63         super(session);
64         this.session = session;
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 Session on which this event occurred.
83      */

84     public Session getSession() {
85
86         return (this.session);
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 ("SessionEvent['" + getSession() + "','" +
107                 getType() + "']");
108
109     }
110
111
112 }
113
Popular Tags