2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.view;
19
20 import java.io.Serializable;
21
22 /***
23 * <p><strong>AbstractSessionBean</strong> is the abstract base class for
24 * data bean(s) that are stored in session scope attributes. It extends
25 * {@link AbstractFacesBean}, so it inherits all of the default behavior
26 * found there. In addition, the following lifecycle methods are called
27 * automatically when the corresponding events occur:</p>
28 * <ul>
29 * <li><code>init()</code> - Called when this bean is initially added
30 * as a session attribute (typically as the result of evaluating a
31 * value binding or method binding expression).</li>
32 * <li><code>passivate()</code> - Called when the servlet container is about
33 * to serialize and remove this session from its current container.</li>
34 * <li><code>activate()</code> - Called when the servlet container has
35 * finished deserializing this session and making it available in a
36 * (potentially different) container.</li>
37 * <li><code>destroy()</code> - Called when the bean is removed from the
38 * session attributes (typically as a result of the session timing out
39 * or being terminated by the application).</li>
40 * </ul>
41 *
42 * $Id: AbstractSessionBean.java 464373 2006-10-16 04:21:54Z rahul $
43 */
44 public abstract class AbstractSessionBean
45 extends AbstractFacesBean implements Serializable {
46
47
48
49
50
51 /***
52 * <p>Create a new session scope bean.</p>
53 */
54 public AbstractSessionBean() {
55 }
56
57
58
59
60
61 /***
62 * <p>This method is called when this bean is initially added to
63 * session scope. Typically, this occurs as a result of evaluating
64 * a value binding or method binding expression, which utilizes the
65 * managed bean facility to instantiate this bean and store it into
66 * session scope.</p>
67 *
68 * <p>You may customize this method to initialize and cache data values
69 * or resources that are required for the lifetime of a particular
70 * user session.</p>
71 */
72 public void init() {
73
74
75
76 }
77
78
79 /***
80 * <p>This method is called when the session containing it is about to be
81 * passivated. Typically, this occurs in a distributed servlet container
82 * when the session is about to be transferred to a different
83 * container instance, after which the <code>activate()</code> method
84 * will be called to indicate that the transfer is complete.</p>
85 *
86 * <p>You may customize this method to release references to session data
87 * or resources that can not be serialized with the session itself.</p>
88 */
89 public void passivate() {
90
91
92
93 }
94
95
96 /***
97 * <p>This method is called when the session containing it was
98 * reactivated.</p>
99 *
100 * <p>You may customize this method to reacquire references to session
101 * data or resources that could not be serialized with the
102 * session itself.</p>
103 */
104 public void activate() {
105
106
107
108 }
109
110
111 /***
112 * <p>This method is called when this bean is removed from
113 * session scope. Typically, this occurs as a result of
114 * the session timing out or being terminated by the application.</p>
115 *
116 * <p>You may customize this method to clean up resources allocated
117 * during the execution of the <code>init()</code> method, or
118 * at any later time during the lifetime of the application.</p>
119 */
120 public void destroy() {
121
122
123
124 }
125
126
127 }