KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > faces > util > event > servlet > ContextEventListener


1 /*
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * "The contents of this file are subject to the Mozilla Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11  * License for the specific language governing rights and limitations under
12  * the License.
13  *
14  * The Original Code is ICEfaces 1.5 open source software code, released
15  * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
16  * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
17  * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
18  *
19  * Contributor(s): _____________________.
20  *
21  * Alternatively, the contents of this file may be used under the terms of
22  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
23  * License), in which case the provisions of the LGPL License are
24  * applicable instead of those above. If you wish to allow use of your
25  * version of this file only under the terms of the LGPL License and not to
26  * allow others to use your version of this file under the MPL, indicate
27  * your decision by deleting the provisions above and replace them with
28  * the notice and other provisions required by the LGPL License. If you do
29  * not delete the provisions above, a recipient may use your version of
30  * this file under either the MPL or the LGPL License."
31  *
32  */

33
34 package com.icesoft.faces.util.event.servlet;
35
36 import java.util.EventListener JavaDoc;
37
38 /**
39  * The listener interface for receiving context events. </p>
40  */

41 public interface ContextEventListener extends EventListener JavaDoc {
42     /**
43      * Indicates the context has been destroyed. </p>
44      *
45      * This is just a relay of the <code>ServletContextEvent</code> that could
46      * normally be received through registering a
47      * <code>ServletContextListener</code>. This event generally indicates that
48      * the application is shutting down, giving the listener time to do proper
49      * clean-up. </p>
50      *
51      * Please note that <code>SessionDestroyedEvent</code>s are fired for every
52      * session in the context before the <code>ContextDestroyedEvent</code> is
53      * fired. </p>
54      *
55      * @param event the <code>ContextDestroyedEvent<code>.
56      * @see javax.servlet.ServletContextListener
57      * @see javax.servlet.ServletContextEvent
58      * @see #sessionDestroyed(SessionDestroyedEvent)
59      */

60     public void contextDestroyed(ContextDestroyedEvent event);
61
62     public void iceFacesIdDisposed(ICEfacesIDDisposedEvent event);
63     
64     /**
65      * Indicates an ICEfaces ID has been retrieved. </p>
66      *
67      * Each time a call results in an ICEfaces ID being retrieved, an
68      * <code>ICEfacesIDRetrievedEvent</code> is fired to all registered
69      * <code>ContextEventListener</code>s. An ICEfaces ID is retrieved on all
70      * initial page requests, but this can also happen on browser reloads.
71      * Because of this, it is the responsibility of the listener to track valid
72      * ICEfaces ID values. </p>
73      *
74      * @param event the <code>ICEfacesIDRetrievedEvent</code> containing the
75      * ICEfaces ID.
76      */

77     public void iceFacesIdRetrieved(ICEfacesIDRetrievedEvent event);
78
79     /**
80      * Indicates that the <code>ContextEventListener</code> is interested in
81      * receiving buffered events. </p>
82      *
83      * It is possible for <code>ICEfacesIDRetrievedEvent</code>s and
84      * <code>ViewNumberRetrievedEvent</code>s to be fired before
85      * <code>ContextEventListener</code>s get a chance to register themselves
86      * with the <code>ContextEventRepeater</code>.
87      * <code>ContextEventListener</code>s that are interested in these events
88      * can return <code>true</code> and all of the events that were fired before
89      * registering are "refired". </p>
90      *
91      * @return <code>true</code> if interested in receiving buffered
92      * <code>ICEfacesIDRetrievedEvents</code> and
93      * <code>ViewNumberRetrievedEvent</code>, <code>false</code> if not.
94      * @see ContextEventRepeater
95      */

96     public boolean receiveBufferedEvents();
97
98     /**
99      * Indicates that a session has been destroyed. </p>
100      *
101      * This is just a relay of the <code>HttpSessionEvent</code> that could
102      * normally be received through registering an
103      * <code>HttpSessionListener</code>. This event generally indicates that a
104      * session got expired, giving the listener time to do clean-up and/or other
105      * appropriate actions. </p>
106      *
107      * @param event the <code>SessionDestroyedEvent</code>.
108      * @see javax.servlet.http.HttpSessionEvent
109      * @see javax.servlet.http.HttpSessionListener
110      */

111     public void sessionDestroyed(SessionDestroyedEvent event);
112
113     /**
114      * Indicates a view number has been retrieved. </p>
115      *
116      * Each time a call results in a view number being retrieved, a
117      * <code>ViewNumberRetrievedEvent</code> is fired to all registered
118      * <code>ContextEventListener</code>s. View numbers are retrieved on all
119      * initial page requests, but this can also happen on browser reloads.
120      * Because of this, it is the responsibility of the listener to track valid
121      * view numbers. </p>
122      *
123      * @param event the <code>ViewNumberRetrievedEvent</code> containing both
124      * the ICEfaces ID and the view number.
125      * @see #iceFacesIdRetrieved(ICEfacesIDRetrievedEvent)
126      */

127     public void viewNumberRetrieved(ViewNumberRetrievedEvent event);
128 }
129
Popular Tags