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.Scope; |
14 | |
import org.apache.shale.tiger.view.Application; |
15 | |
import org.apache.shale.tiger.view.Destroy; |
16 | |
import org.apache.shale.tiger.view.Init; |
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
@Application |
22 | |
@Bean(name="applicationBean", scope=Scope.APPLICATION) |
23 | 0 | public class ApplicationBean { |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | private StringBuffer events = new StringBuffer(); |
33 | |
|
34 | |
public String getEvents() { |
35 | 0 | return events.toString(); |
36 | |
} |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
@Init |
44 | |
public void myInit() { |
45 | 0 | events.append("init/"); |
46 | 0 | System.out.println("ApplicationBean.init()"); |
47 | 0 | } |
48 | |
|
49 | |
|
50 | |
@Destroy |
51 | |
public void myDestroy() { |
52 | 0 | events.append("destroy/"); |
53 | 0 | System.out.println("ApplicationBean.destroy()"); |
54 | 0 | } |
55 | |
|
56 | |
|
57 | |
} |