1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.apache.tapestry.services.impl; |
16 |
|
|
17 |
|
import java.util.List; |
18 |
|
|
19 |
|
import javax.servlet.ServletContext; |
20 |
|
|
21 |
|
import org.apache.tapestry.services.ApplicationGlobals; |
22 |
|
import org.apache.tapestry.spec.IApplicationSpecification; |
23 |
|
import org.apache.tapestry.web.WebActivator; |
24 |
|
import org.apache.tapestry.web.WebContext; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
7 |
public class ApplicationGlobalsImpl implements ApplicationGlobals |
33 |
|
{ |
34 |
|
private WebActivator _activator; |
35 |
|
|
36 |
|
private IApplicationSpecification _specification; |
37 |
|
|
38 |
|
private WebContext _webContext; |
39 |
|
|
40 |
|
private List _factoryServices; |
41 |
|
|
42 |
|
private ServletContext _servletContext; |
43 |
|
|
44 |
|
public void storeActivator(WebActivator activator) |
45 |
|
{ |
46 |
6 |
_activator = activator; |
47 |
6 |
} |
48 |
|
|
49 |
|
public void storeSpecification(IApplicationSpecification applicationSpecification) |
50 |
|
{ |
51 |
6 |
_specification = applicationSpecification; |
52 |
6 |
} |
53 |
|
|
54 |
|
public WebActivator getActivator() |
55 |
|
{ |
56 |
2 |
return _activator; |
57 |
|
} |
58 |
|
|
59 |
|
public IApplicationSpecification getSpecification() |
60 |
|
{ |
61 |
4 |
return _specification; |
62 |
|
} |
63 |
|
|
64 |
|
public String getActivatorName() |
65 |
|
{ |
66 |
0 |
return _activator.getActivatorName(); |
67 |
|
} |
68 |
|
|
69 |
|
public WebContext getWebContext() |
70 |
|
{ |
71 |
1 |
return _webContext; |
72 |
|
} |
73 |
|
|
74 |
|
public void storeWebContext(WebContext context) |
75 |
|
{ |
76 |
1 |
_webContext = context; |
77 |
1 |
} |
78 |
|
|
79 |
|
public void storeFactoryServices(List factoryServices) |
80 |
|
{ |
81 |
0 |
_factoryServices = factoryServices; |
82 |
0 |
} |
83 |
|
|
84 |
|
public List getFactoryServices() |
85 |
|
{ |
86 |
0 |
return _factoryServices; |
87 |
|
} |
88 |
|
|
89 |
|
public ServletContext getServletContext() |
90 |
|
{ |
91 |
1 |
return _servletContext; |
92 |
|
} |
93 |
|
|
94 |
|
public void storeServletContext(ServletContext context) |
95 |
|
{ |
96 |
1 |
_servletContext = context; |
97 |
1 |
} |
98 |
|
} |