1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.struts2.dispatcher.ng.listener;
22
23 import org.apache.struts2.dispatcher.ng.HostConfig;
24
25 import javax.servlet.ServletContext;
26 import java.util.Iterator;
27 import java.util.Collections;
28
29 /***
30 * Host configuration that just holds a ServletContext
31 */
32 public class ListenerHostConfig implements HostConfig {
33 private ServletContext servletContext;
34
35 public ListenerHostConfig(ServletContext servletContext) {
36 this.servletContext = servletContext;
37 }
38
39 public String getInitParameter(String key) {
40 return null;
41 }
42
43 public Iterator<String> getInitParameterNames() {
44 return Collections.<String>emptyList().iterator();
45 }
46
47 public ServletContext getServletContext() {
48 return servletContext;
49 }
50 }