1 package org.andromda.cartridges.jsf.portlet.myfaces.tomahawk.support;
2
3 import java.io.InputStream;
4 import java.net.MalformedURLException;
5 import java.net.URL;
6 import java.util.Enumeration;
7 import java.util.Set;
8
9 import javax.portlet.PortletContext;
10 import javax.servlet.RequestDispatcher;
11 import javax.servlet.Servlet;
12 import javax.servlet.ServletContext;
13 import javax.servlet.ServletException;
14
15
16
17
18 public class ServletContextWrapper implements ServletContext
19 {
20 private PortletContext portletContext;
21
22
23
24
25 public ServletContextWrapper(PortletContext portletContext)
26 {
27 this.portletContext = portletContext;
28 }
29
30
31
32
33 public Object getAttribute(String arg0)
34 {
35 return portletContext.getAttribute(arg0);
36 }
37
38
39
40
41 public Enumeration getAttributeNames()
42 {
43 return portletContext.getAttributeNames();
44 }
45
46
47
48
49
50 public ServletContext getContext(String arg0)
51 {
52
53 return null;
54 }
55
56
57
58
59 public String getInitParameter(String arg0)
60 {
61 return portletContext.getInitParameter(arg0);
62 }
63
64
65
66
67 public Enumeration getInitParameterNames()
68 {
69 return portletContext.getInitParameterNames();
70 }
71
72
73
74
75 public int getMajorVersion()
76 {
77 return portletContext.getMajorVersion();
78 }
79
80
81
82
83 public String getMimeType(String arg0)
84 {
85 return portletContext.getMimeType(arg0);
86 }
87
88
89
90
91 public int getMinorVersion()
92 {
93 return portletContext.getMinorVersion();
94 }
95
96
97
98
99
100 public RequestDispatcher getNamedDispatcher(String arg0)
101 {
102
103 return null;
104 }
105
106
107
108
109 public String getRealPath(String arg0)
110 {
111 return portletContext.getRealPath(arg0);
112 }
113
114
115
116
117
118 public RequestDispatcher getRequestDispatcher(String arg0)
119 {
120
121 return null;
122 }
123
124
125
126
127 public URL getResource(String arg0) throws MalformedURLException
128 {
129 return portletContext.getResource(arg0);
130 }
131
132
133
134
135 public InputStream getResourceAsStream(String arg0)
136 {
137 return portletContext.getResourceAsStream(arg0);
138 }
139
140
141
142
143 public Set getResourcePaths(String arg0)
144 {
145 return portletContext.getResourcePaths(arg0);
146 }
147
148
149
150
151 public String getServerInfo()
152 {
153 return portletContext.getServerInfo();
154 }
155
156
157
158
159
160
161 @Deprecated
162 public Servlet getServlet(String arg0) throws ServletException
163 {
164
165 return null;
166 }
167
168
169
170
171 public String getServletContextName()
172 {
173 return portletContext.getPortletContextName();
174 }
175
176
177
178
179
180
181 @Deprecated
182 public Enumeration getServletNames() {
183
184 return null;
185 }
186
187
188
189
190
191
192 @Deprecated
193 public Enumeration getServlets()
194 {
195
196 return null;
197 }
198
199
200
201
202
203 @Deprecated
204 public void log(Exception arg0, String arg1)
205 {
206 portletContext.log(arg1, new Exception(arg0));
207 }
208
209
210
211
212
213 public void log(String arg0, Throwable arg1)
214 {
215 portletContext.log(arg0, arg1);
216 }
217
218
219
220
221 public void log(String arg0)
222 {
223 portletContext.log(arg0);
224 }
225
226
227
228
229 public void removeAttribute(String arg0)
230 {
231 portletContext.removeAttribute(arg0);
232 }
233
234
235
236
237
238 public void setAttribute(String arg0, Object arg1)
239 {
240 portletContext.setAttribute(arg0, arg1);
241 }
242
243
244
245
246 public String getContextPath()
247 {
248 return portletContext.getPortletContextName();
249 }
250 }