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
19
20 package org.apache.shale.examples.test.view;
21
22 import javax.faces.context.FacesContext;
23 import org.apache.shale.view.AbstractViewController;
24
25 /***
26 * <p>First page for lifecycle event tests.</p>
27 */
28 public class Lifecycle1 extends AbstractViewController {
29
30
31
32
33
34
35 private Recorder recorder = null;
36 public Recorder getRecorder() {
37 return this.recorder;
38 }
39 public void setRecorder(Recorder recorder) {
40 this.recorder = recorder;
41 }
42
43
44
45
46
47 /***
48 * <p>Record an init event.</p>
49 */
50 public void init() {
51 getRecorder().record("init1");
52 System.out.println("Lifecycle1.init()");
53 if (FacesContext.getCurrentInstance() == null) {
54 getRecorder().record("noContext");
55 System.out.println(" noContext");
56 }
57 }
58
59
60 /***
61 * <p>Record a preprocess event.</p>
62 */
63 public void preprocess() {
64 getRecorder().record("preprocess1");
65 System.out.println("Lifecycle1.preprocess()");
66 }
67
68
69 /***
70 * <p>Record a prerender event.</p>
71 */
72 public void prerender() {
73 getRecorder().record("prerender1");
74 System.out.println("Lifecycle1.prerender()");
75 }
76
77
78 /***
79 * <p>Record a destroy event.</p>
80 */
81 public void destroy() {
82 getRecorder().record("destroy1");
83 System.out.println("Lifecycle1.destroy()");
84 System.out.println("Lifecycle1.init()");
85 if (FacesContext.getCurrentInstance() == null) {
86 getRecorder().record("noContext");
87 System.out.println(" noContext");
88 }
89 }
90
91
92 }