1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.miloss.fgsms.presentation;
23
24 import java.io.IOException;
25 import java.net.URL;
26 import java.util.Properties;
27 import javax.servlet.ServletContext;
28 import javax.servlet.http.HttpServletRequest;
29 import javax.servlet.http.HttpServletResponse;
30 import org.miloss.fgsms.common.Constants.AuthMode;
31 import org.miloss.fgsms.services.interfaces.agentcallbackservice.RemoteAgentCallbackPort;
32 import org.miloss.fgsms.services.interfaces.automatedreportingservice.AutomatedReportingService;
33 import org.miloss.fgsms.services.interfaces.dataaccessservice.DataAccessService;
34 import org.miloss.fgsms.services.interfaces.policyconfiguration.PCS;
35 import org.miloss.fgsms.services.interfaces.reportingservice.ReportingService;
36 import org.miloss.fgsms.services.interfaces.status.OpStatusService;
37 import org.miloss.fgsms.services.interfaces.status.StatusService;
38
39
40
41
42
43
44
45
46
47
48
49
50 public class ProxyLoader implements IProxyLoader {
51
52 public static final String PROXY_LOADER_SESSION_KEY = "org.miloss.fgsms.proxyloader";
53
54 public static ProxyLoader getInstance(ServletContext application) throws Exception {
55 Object attribute = application.getAttribute(PROXY_LOADER_SESSION_KEY);
56 if (attribute != null && attribute instanceof ProxyLoader) {
57 return (ProxyLoader) attribute;
58 }
59 ProxyLoader pl = new ProxyLoader(application);
60 application.setAttribute(PROXY_LOADER_SESSION_KEY, pl);
61 return pl;
62 }
63
64 private ProxyLoader(ServletContext application) throws Exception {
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 try {
82 Class<?> c = Thread.currentThread().getContextClassLoader().loadClass("org.apache.cxf.transport.http.HTTPConduit");
83 if (c != null) {
84 object = new ProxyLoaderCXF(application);
85 return;
86 }
87 } catch (ClassNotFoundException cnf) {
88 }
89 throw new ClassNotFoundException("Could not accurately determine if we are operating in the CXF of JbossWS-Native environment");
90
91 }
92 IProxyLoader object;
93
94 @Override
95 public AuthMode getAuthmode() {
96 return object.getAuthmode();
97 }
98
99 @Override
100 public boolean uddiConfigured() {
101 return object.uddiConfigured();
102 }
103
104
105
106
107
108
109
110
111
112
113
114 @Override
115 public PCS GetPCSForUsernamePasswordLogin(ServletContext application, String username, String password) {
116 return object.GetPCSForUsernamePasswordLogin(application, username, password);
117 }
118
119 @Override
120 public PCS GetPCS(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
121 return object.GetPCS(application, request, response);
122 }
123
124 @Override
125 public DataAccessService GetDAS(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
126 return object.GetDAS(application, request, response);
127 }
128
129 @Override
130 public ReportingService GetRS(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
131 return object.GetRS(application, request, response);
132 }
133
134 @Override
135 public AutomatedReportingService GetARS(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
136 return object.GetARS(application, request, response);
137 }
138
139 @Override
140 public StatusService GetSS(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
141 return object.GetSS(application, request, response);
142 }
143
144 @Override
145 public UDDIConfig GetUDDIInquiryConfig(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
146 return object.GetUDDIInquiryConfig(application, request, response);
147 }
148
149 @Override
150 public String getKeyStoreTrustStoreDirectory() {
151 return object.getKeyStoreTrustStoreDirectory();
152 }
153
154 @Override
155 public Properties getRawConfiguration() {
156 return object.getRawConfiguration();
157 }
158
159 @Override
160 public URL getRawConfigurationURL() {
161 return object.getRawConfigurationURL();
162 }
163
164 @Override
165 public OpStatusService GetOpStat(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
166 return object.GetOpStat(application, request, response);
167 }
168
169 @Override
170 public RemoteAgentCallbackPort GetAgentCallBack(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
171 return object.GetAgentCallBack(application, request, response);
172 }
173
174 @Override
175 public OpStatusService GetAgentCallBackOpStat(ServletContext application, HttpServletRequest request, HttpServletResponse response) throws IOException {
176 return object.GetAgentCallBackOpStat(application, request, response);
177 }
178
179 @Override
180 public boolean isSecure() {
181 return object.isSecure();
182 }
183 }