1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.orchestra.frameworkAdapter.local;
20
21 import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter;
22 import org.springframework.context.ApplicationContextAware;
23 import org.springframework.context.ConfigurableApplicationContext;
24 import org.springframework.context.ApplicationContext;
25 import org.springframework.beans.BeansException;
26
27 import java.io.IOException;
28 import java.util.HashMap;
29 import java.util.Map;
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public class LocalFrameworkAdapter extends FrameworkAdapter implements ApplicationContextAware
62 {
63 private ConfigurableApplicationContext configurableApplicationContext;
64
65 private final Map sessionMap = new HashMap();
66 private final Map requestMap = new HashMap();
67 private final Map requestParameterMap = new HashMap();
68 private final Map initMap = new HashMap();
69
70 public String getInitParameter(String key)
71 {
72 return (String) initMap.get(key);
73 }
74
75 public Object getRequestParameterAttribute(String key)
76 {
77 return requestParameterMap.get(key);
78 }
79
80 public boolean containsRequestParameterAttribute(String key)
81 {
82 return requestParameterMap.containsKey(key);
83 }
84
85 public void setRequestParameterAttribute(String key , Object value)
86 {
87 requestParameterMap.put(key, value);
88 }
89
90 public Object getRequestAttribute(String key)
91 {
92 return requestMap.get(key);
93 }
94
95 public void setRequestAttribute(String key, Object value)
96 {
97 requestMap.put(key, value);
98 }
99
100 public void clearRequestMap()
101 {
102 requestMap.clear();
103 }
104
105 public boolean containsRequestAttribute(String key)
106 {
107 return requestMap.containsKey(key);
108 }
109
110 public Object getSessionAttribute(String key)
111 {
112 return sessionMap.get(key);
113 }
114
115 public void setSessionAttribute(String key, Object value)
116 {
117 sessionMap.put(key, value);
118 }
119
120 public boolean containsSessionAttribute(String key)
121 {
122 return sessionMap.containsKey(key);
123 }
124
125 protected ConfigurableApplicationContext getApplicationContext()
126 {
127 return configurableApplicationContext;
128 }
129
130 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
131 {
132 setApplicationContext((ConfigurableApplicationContext) applicationContext);
133 }
134
135 public void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext)
136 {
137 this.configurableApplicationContext = configurableApplicationContext;
138 }
139
140 public void redirect(String url) throws IOException
141 {
142 }
143
144 public Object getBean(String name)
145 {
146 if (!getApplicationContext().containsBean(name))
147 {
148 return null;
149 }
150 return getApplicationContext().getBean(name);
151 }
152
153 public void invokeNavigation(String navigationName)
154 {
155 }
156 }