1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.apache.shale.examples.test.tiger; |
11 | |
|
12 | |
import org.apache.shale.tiger.managed.Bean; |
13 | |
import org.apache.shale.tiger.managed.Property; |
14 | |
import org.apache.shale.tiger.managed.Scope; |
15 | |
import org.apache.shale.tiger.view.Destroy; |
16 | |
import org.apache.shale.tiger.view.Init; |
17 | |
import org.apache.shale.tiger.view.Preprocess; |
18 | |
import org.apache.shale.tiger.view.Prerender; |
19 | |
import org.apache.shale.tiger.view.View; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
@Bean(name="managed", scope=Scope.REQUEST) |
26 | |
@View |
27 | 0 | public class Managed { |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
@Property(value="#{applicationBean}") |
37 | |
private ApplicationBean applicationBean; |
38 | |
|
39 | |
public ApplicationBean getApplicationBean() { |
40 | 0 | return this.applicationBean; |
41 | |
} |
42 | |
|
43 | |
public void setApplicationBean(ApplicationBean applicationBean) { |
44 | 0 | this.applicationBean = applicationBean; |
45 | 0 | } |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | 0 | private StringBuffer events = new StringBuffer(); |
52 | |
|
53 | |
public String getEvents() { |
54 | 0 | return events.toString(); |
55 | |
} |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
@Property(value="#{requestBean}") |
63 | |
private RequestBean requestBean; |
64 | |
|
65 | |
public RequestBean getRequestBean() { |
66 | 0 | return this.requestBean; |
67 | |
} |
68 | |
|
69 | |
public void setRequestBean(RequestBean requestBean) { |
70 | 0 | this.requestBean = requestBean; |
71 | 0 | } |
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
@Property(value="#{sessionBean}") |
78 | |
private SessionBean sessionBean; |
79 | |
|
80 | |
public SessionBean getSessionBean() { |
81 | 0 | return this.sessionBean; |
82 | |
} |
83 | |
|
84 | |
public void setSessionBean(SessionBean sessionBean) { |
85 | 0 | this.sessionBean = sessionBean; |
86 | 0 | } |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
@Init |
93 | |
public void myInit() { |
94 | 0 | events.append("init/"); |
95 | 0 | System.out.println("ManagedBean.init()"); |
96 | 0 | } |
97 | |
|
98 | |
|
99 | |
@Preprocess |
100 | |
public void myPreprocess() { |
101 | 0 | events.append("preprocess/"); |
102 | 0 | System.out.println("ManagedBean.preprocess()"); |
103 | 0 | } |
104 | |
|
105 | |
|
106 | |
@Prerender |
107 | |
public void myPrerender() { |
108 | 0 | events.append("prerender/"); |
109 | 0 | System.out.println("ManagedBean.prerender()"); |
110 | 0 | } |
111 | |
|
112 | |
|
113 | |
@Destroy |
114 | |
public void myDestroy() { |
115 | 0 | events.append("destroy/"); |
116 | 0 | System.out.println("ManagedBean.destroy()"); |
117 | 0 | } |
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
public String resubmit() { |
125 | 0 | System.out.println("ManagedBean.resubmit()"); |
126 | 0 | return null; |
127 | |
} |
128 | |
|
129 | |
|
130 | |
} |