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.tiger;
21
22 import org.apache.shale.tiger.managed.Bean;
23 import org.apache.shale.tiger.managed.Property;
24 import org.apache.shale.tiger.managed.Scope;
25 import org.apache.shale.tiger.view.Destroy;
26 import org.apache.shale.tiger.view.Init;
27 import org.apache.shale.tiger.view.Request;
28
29 /***
30 * <p>Request scope managed bean declared with annotations.</p>
31 */
32 @Request
33 @Bean(name="requestBean", scope=Scope.REQUEST)
34 public class RequestBean {
35
36
37
38
39
40 /***
41 * <p>Injected application bean instance.</p>
42 */
43 @Property(value="#{applicationBean}")
44 private ApplicationBean applicationBean;
45
46 public ApplicationBean getApplicationBean() {
47 return this.applicationBean;
48 }
49
50 public void setApplicationBean(ApplicationBean applicationBean) {
51 this.applicationBean = applicationBean;
52 }
53
54
55 /***
56 * <p>Return the events that have occurred so far.</p>
57 */
58 private StringBuffer events = new StringBuffer();
59
60 public String getEvents() {
61 return events.toString();
62 }
63
64
65
66 /***
67 * <p>Injected session bean instance.</p>
68 */
69 @Property(value="#{sessionBean}")
70 private SessionBean sessionBean;
71
72 public SessionBean getSessionBean() {
73 return this.sessionBean;
74 }
75
76 public void setSessionBean(SessionBean sessionBean) {
77 this.sessionBean = sessionBean;
78 }
79
80
81
82
83
84 @Init
85 public void myInit() {
86 events.append("init/");
87 System.out.println("RequestBean.init()");
88 }
89
90
91 @Destroy
92 public void myDestroy() {
93 events.append("destroy/");
94 System.out.println("RequestBean.destroy()");
95 }
96
97
98 }