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.Request; |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
@Request |
23 | |
@Bean(name="requestBean", scope=Scope.REQUEST) |
24 | 0 | public class RequestBean { |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
@Property(value="#{applicationBean}") |
34 | |
private ApplicationBean applicationBean; |
35 | |
|
36 | |
public ApplicationBean getApplicationBean() { |
37 | 0 | return this.applicationBean; |
38 | |
} |
39 | |
|
40 | |
public void setApplicationBean(ApplicationBean applicationBean) { |
41 | 0 | this.applicationBean = applicationBean; |
42 | 0 | } |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | 0 | private StringBuffer events = new StringBuffer(); |
49 | |
|
50 | |
public String getEvents() { |
51 | 0 | return events.toString(); |
52 | |
} |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
@Property(value="#{sessionBean}") |
60 | |
private SessionBean sessionBean; |
61 | |
|
62 | |
public SessionBean getSessionBean() { |
63 | 0 | return this.sessionBean; |
64 | |
} |
65 | |
|
66 | |
public void setSessionBean(SessionBean sessionBean) { |
67 | 0 | this.sessionBean = sessionBean; |
68 | 0 | } |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
@Init |
75 | |
public void myInit() { |
76 | 0 | events.append("init/"); |
77 | 0 | System.out.println("RequestBean.init()"); |
78 | 0 | } |
79 | |
|
80 | |
|
81 | |
@Destroy |
82 | |
public void myDestroy() { |
83 | 0 | events.append("destroy/"); |
84 | 0 | System.out.println("RequestBean.destroy()"); |
85 | 0 | } |
86 | |
|
87 | |
|
88 | |
} |