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