1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.apache.ws.scout.registry; |
17 | |
|
18 | |
import java.io.ByteArrayInputStream; |
19 | |
import java.io.ByteArrayOutputStream; |
20 | |
import java.io.IOException; |
21 | |
import java.io.StringReader; |
22 | |
import java.net.URI; |
23 | |
import java.net.URISyntaxException; |
24 | |
import java.security.AccessController; |
25 | |
import java.security.PrivilegedAction; |
26 | |
import java.util.Arrays; |
27 | |
import java.util.Properties; |
28 | |
|
29 | |
import javax.xml.bind.JAXBContext; |
30 | |
import javax.xml.bind.JAXBElement; |
31 | |
import javax.xml.bind.JAXBException; |
32 | |
import javax.xml.bind.Marshaller; |
33 | |
import javax.xml.bind.Unmarshaller; |
34 | |
import javax.xml.parsers.DocumentBuilder; |
35 | |
import javax.xml.parsers.DocumentBuilderFactory; |
36 | |
import javax.xml.parsers.ParserConfigurationException; |
37 | |
import javax.xml.transform.stream.StreamSource; |
38 | |
|
39 | |
import org.apache.commons.logging.Log; |
40 | |
import org.apache.commons.logging.LogFactory; |
41 | |
import org.apache.ws.scout.model.uddi.v2.AssertionStatusReport; |
42 | |
import org.apache.ws.scout.model.uddi.v2.AuthToken; |
43 | |
import org.apache.ws.scout.model.uddi.v2.BindingDetail; |
44 | |
import org.apache.ws.scout.model.uddi.v2.BindingTemplate; |
45 | |
import org.apache.ws.scout.model.uddi.v2.BusinessDetail; |
46 | |
import org.apache.ws.scout.model.uddi.v2.BusinessEntity; |
47 | |
import org.apache.ws.scout.model.uddi.v2.BusinessList; |
48 | |
import org.apache.ws.scout.model.uddi.v2.BusinessService; |
49 | |
import org.apache.ws.scout.model.uddi.v2.CategoryBag; |
50 | |
import org.apache.ws.scout.model.uddi.v2.DeleteBinding; |
51 | |
import org.apache.ws.scout.model.uddi.v2.DeleteBusiness; |
52 | |
import org.apache.ws.scout.model.uddi.v2.DeletePublisherAssertions; |
53 | |
import org.apache.ws.scout.model.uddi.v2.DeleteService; |
54 | |
import org.apache.ws.scout.model.uddi.v2.DeleteTModel; |
55 | |
import org.apache.ws.scout.model.uddi.v2.DiscoveryURLs; |
56 | |
import org.apache.ws.scout.model.uddi.v2.DispositionReport; |
57 | |
import org.apache.ws.scout.model.uddi.v2.FindBinding; |
58 | |
import org.apache.ws.scout.model.uddi.v2.FindBusiness; |
59 | |
import org.apache.ws.scout.model.uddi.v2.FindQualifiers; |
60 | |
import org.apache.ws.scout.model.uddi.v2.FindService; |
61 | |
import org.apache.ws.scout.model.uddi.v2.FindTModel; |
62 | |
import org.apache.ws.scout.model.uddi.v2.GetAssertionStatusReport; |
63 | |
import org.apache.ws.scout.model.uddi.v2.GetAuthToken; |
64 | |
import org.apache.ws.scout.model.uddi.v2.GetBusinessDetail; |
65 | |
import org.apache.ws.scout.model.uddi.v2.GetPublisherAssertions; |
66 | |
import org.apache.ws.scout.model.uddi.v2.GetRegisteredInfo; |
67 | |
import org.apache.ws.scout.model.uddi.v2.GetServiceDetail; |
68 | |
import org.apache.ws.scout.model.uddi.v2.GetTModelDetail; |
69 | |
import org.apache.ws.scout.model.uddi.v2.IdentifierBag; |
70 | |
import org.apache.ws.scout.model.uddi.v2.Name; |
71 | |
import org.apache.ws.scout.model.uddi.v2.ObjectFactory; |
72 | |
import org.apache.ws.scout.model.uddi.v2.PublisherAssertion; |
73 | |
import org.apache.ws.scout.model.uddi.v2.PublisherAssertions; |
74 | |
import org.apache.ws.scout.model.uddi.v2.RegisteredInfo; |
75 | |
import org.apache.ws.scout.model.uddi.v2.SaveBinding; |
76 | |
import org.apache.ws.scout.model.uddi.v2.SaveBusiness; |
77 | |
import org.apache.ws.scout.model.uddi.v2.SaveService; |
78 | |
import org.apache.ws.scout.model.uddi.v2.SaveTModel; |
79 | |
import org.apache.ws.scout.model.uddi.v2.ServiceDetail; |
80 | |
import org.apache.ws.scout.model.uddi.v2.ServiceList; |
81 | |
import org.apache.ws.scout.model.uddi.v2.SetPublisherAssertions; |
82 | |
import org.apache.ws.scout.model.uddi.v2.TModel; |
83 | |
import org.apache.ws.scout.model.uddi.v2.TModelBag; |
84 | |
import org.apache.ws.scout.model.uddi.v2.TModelDetail; |
85 | |
import org.apache.ws.scout.model.uddi.v2.TModelList; |
86 | |
import org.apache.ws.scout.transport.Transport; |
87 | |
import org.apache.ws.scout.transport.TransportException; |
88 | |
import org.apache.ws.scout.util.XMLUtils; |
89 | |
import org.w3c.dom.Document; |
90 | |
import org.w3c.dom.Element; |
91 | |
import org.w3c.dom.NodeList; |
92 | |
import org.xml.sax.SAXException; |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
public class RegistryImpl implements IRegistry { |
107 | |
|
108 | |
public static final String INQUIRY_ENDPOINT_PROPERTY_NAME = "scout.proxy.inquiryURL"; |
109 | |
public static final String PUBLISH_ENDPOINT_PROPERTY_NAME = "scout.proxy.publishURL"; |
110 | |
public static final String SECURITY_ENDPOINT_PROPERTY_NAME = "scout.proxy.securityURL"; |
111 | |
public static final String ADMIN_ENDPOINT_PROPERTY_NAME = "scout.proxy.adminURL"; |
112 | |
public static final String TRANSPORT_CLASS_PROPERTY_NAME = "scout.proxy.transportClass"; |
113 | |
public static final String SECURITY_PROVIDER_PROPERTY_NAME = "scout.proxy.securityProvider"; |
114 | |
public static final String PROTOCOL_HANDLER_PROPERTY_NAME = "scout.proxy.protocolHandler"; |
115 | |
public static final String UDDI_VERSION_PROPERTY_NAME = "scout.proxy.uddiVersion"; |
116 | |
public static final String UDDI_NAMESPACE_PROPERTY_NAME = "scout.proxy.uddiNamespace"; |
117 | |
|
118 | |
public static final String DEFAULT_INQUIRY_ENDPOINT = "http://localhost/juddi/inquiry"; |
119 | |
public static final String DEFAULT_PUBLISH_ENDPOINT = "http://localhost/juddi/publish"; |
120 | |
public static final String DEFAULT_SECURITY_ENDPOINT = "http://localhost/juddi/security"; |
121 | |
public static final String DEFAULT_ADMIN_ENDPOINT = "http://localhost/juddi/admin"; |
122 | |
public static final String DEFAULT_TRANSPORT_CLASS = "org.apache.ws.scout.transport.AxisTransport"; |
123 | |
public static final String DEFAULT_SECURITY_PROVIDER = "com.sun.net.ssl.internal.ssl.Provider"; |
124 | |
public static final String DEFAULT_PROTOCOL_HANDLER = "com.sun.net.ssl.internal.www.protocol"; |
125 | |
public static final String DEFAULT_UDDI_VERSION = "2.0"; |
126 | |
public static final String DEFAULT_UDDI_NAMESPACE = "urn:uddi-org:api_v2"; |
127 | |
|
128 | |
private URI adminURI; |
129 | |
private URI inquiryURI; |
130 | |
private URI publishURI; |
131 | |
private URI securityURI; |
132 | |
|
133 | |
private Transport transport; |
134 | |
|
135 | |
private String securityProvider; |
136 | |
private String protocolHandler; |
137 | |
private String uddiVersion; |
138 | |
private String uddiNamespace; |
139 | |
|
140 | 348 | private ObjectFactory objectFactory = new ObjectFactory(); |
141 | |
|
142 | 348 | private Marshaller marshaller = null; |
143 | 348 | private Unmarshaller unmarshaller = null; |
144 | |
|
145 | 6 | private static Log log = LogFactory.getLog(RegistryImpl.class); |
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
public RegistryImpl(Properties props) { |
151 | 348 | super(); |
152 | |
|
153 | 348 | this.init(props); |
154 | 348 | } |
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
private void init(Properties props) { |
160 | |
|
161 | |
|
162 | 348 | if (props == null) |
163 | 0 | props = new Properties(); |
164 | |
|
165 | |
|
166 | |
try { |
167 | 348 | String iURL = props.getProperty(INQUIRY_ENDPOINT_PROPERTY_NAME); |
168 | 348 | if (iURL != null) |
169 | 0 | this.setInquiryURI(new URI(iURL)); |
170 | |
else |
171 | 348 | this.setInquiryURI(new URI(DEFAULT_INQUIRY_ENDPOINT)); |
172 | |
|
173 | 348 | String pURL = props.getProperty(PUBLISH_ENDPOINT_PROPERTY_NAME); |
174 | 348 | if (pURL != null) |
175 | 0 | this.setPublishURI(new URI(pURL)); |
176 | |
else |
177 | 348 | this.setPublishURI(new URI(DEFAULT_PUBLISH_ENDPOINT)); |
178 | |
|
179 | 348 | String sURL = props.getProperty(SECURITY_ENDPOINT_PROPERTY_NAME); |
180 | 348 | if (sURL != null) |
181 | 0 | this.setSecurityURI(new URI(sURL)); |
182 | |
else |
183 | 348 | this.setSecurityURI(new URI(DEFAULT_SECURITY_ENDPOINT)); |
184 | |
|
185 | 348 | String aURL = props.getProperty(ADMIN_ENDPOINT_PROPERTY_NAME); |
186 | 348 | if (aURL != null) |
187 | 0 | this.setAdminURI(new URI(aURL)); |
188 | |
else |
189 | 348 | this.setAdminURI(new URI(DEFAULT_ADMIN_ENDPOINT)); |
190 | 0 | } catch (URISyntaxException muex) { |
191 | 0 | throw new RuntimeException(muex); |
192 | 348 | } |
193 | |
|
194 | 348 | String secProvider = props.getProperty(SECURITY_PROVIDER_PROPERTY_NAME); |
195 | 348 | if (secProvider != null) |
196 | 0 | this.setSecurityProvider(secProvider); |
197 | |
else |
198 | 348 | this.setSecurityProvider(DEFAULT_SECURITY_PROVIDER); |
199 | |
|
200 | 348 | String protoHandler = props.getProperty(PROTOCOL_HANDLER_PROPERTY_NAME); |
201 | 348 | if (protoHandler != null) |
202 | 0 | this.setProtocolHandler(protoHandler); |
203 | |
else |
204 | 348 | this.setProtocolHandler(DEFAULT_PROTOCOL_HANDLER); |
205 | |
|
206 | 348 | String uddiVer = props.getProperty(UDDI_VERSION_PROPERTY_NAME); |
207 | 348 | if (uddiVer != null) |
208 | 348 | this.setUddiVersion(uddiVer); |
209 | |
else |
210 | 0 | this.setUddiVersion(DEFAULT_UDDI_VERSION); |
211 | |
|
212 | 348 | String uddiNS = props.getProperty(UDDI_NAMESPACE_PROPERTY_NAME); |
213 | 348 | if (uddiNS != null) |
214 | 348 | this.setUddiNamespace(uddiNS); |
215 | |
else |
216 | 0 | this.setUddiNamespace(DEFAULT_UDDI_NAMESPACE); |
217 | |
|
218 | 348 | String transClass = props.getProperty(TRANSPORT_CLASS_PROPERTY_NAME); |
219 | 348 | if (transClass != null) |
220 | 336 | this.setTransport(this.getTransport(transClass)); |
221 | |
else |
222 | 12 | this.setTransport(this.getTransport(DEFAULT_TRANSPORT_CLASS)); |
223 | |
|
224 | |
try |
225 | |
{ |
226 | 348 | JAXBContext context = JAXBContextUtil.getContext(JAXBContextUtil.UDDI_V2_VERSION); |
227 | 348 | JAXBContext v3context = JAXBContextUtil.getContext(JAXBContextUtil.UDDI_V3_VERSION); |
228 | 348 | if ("3.0".equals(uddiVer)) { |
229 | 0 | this.unmarshaller = v3context.createUnmarshaller(); |
230 | |
} else { |
231 | 348 | this.unmarshaller = context.createUnmarshaller(); |
232 | |
} |
233 | 348 | this.marshaller = context.createMarshaller(); |
234 | |
} |
235 | 0 | catch(JAXBException e) |
236 | |
{ |
237 | 0 | throw new RuntimeException(e); |
238 | 348 | } |
239 | 348 | } |
240 | |
|
241 | |
|
242 | |
|
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
public String execute(String uddiRequest, String urltype) |
248 | |
throws TransportException { |
249 | 0 | URI endPointURL = null; |
250 | 0 | if (urltype.equalsIgnoreCase("INQUIRY")) |
251 | 0 | endPointURL = this.getInquiryURI(); |
252 | |
else |
253 | 0 | endPointURL = this.getPublishURI(); |
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | 0 | return transport.send(uddiRequest, endPointURL); |
259 | |
} |
260 | |
|
261 | |
|
262 | |
|
263 | |
|
264 | |
public JAXBElement<?> execute(JAXBElement<?> uddiRequest, URI endPointURI) |
265 | |
throws RegistryException { |
266 | |
|
267 | 1746 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
268 | |
|
269 | |
Document doc; |
270 | |
try { |
271 | 1746 | DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); |
272 | 1746 | docBuilderFactory.setNamespaceAware(true); |
273 | 1746 | DocumentBuilder docBuilder= docBuilderFactory.newDocumentBuilder(); |
274 | 1746 | this.marshaller.marshal(uddiRequest, baos); |
275 | 1746 | doc = docBuilder.parse(new ByteArrayInputStream(baos.toByteArray())); |
276 | 0 | } catch (SAXException saxe) { |
277 | 0 | throw (new RegistryException(saxe)); |
278 | 0 | } catch (ParserConfigurationException pce) { |
279 | 0 | throw (new RegistryException(pce)); |
280 | 0 | } catch (IOException ioe) { |
281 | 0 | throw (new RegistryException(ioe)); |
282 | 0 | } catch (JAXBException ioe) { |
283 | 0 | throw (new RegistryException(ioe)); |
284 | 1746 | } |
285 | 1746 | Element request = doc.getDocumentElement(); |
286 | |
|
287 | 1746 | request.setAttribute("xmlns", this.getUddiNamespace()); |
288 | 1746 | if (!"3.0".equals(this.getUddiVersion())) { |
289 | 1746 | request.setAttribute("generic", this.getUddiVersion()); |
290 | |
} |
291 | |
|
292 | |
|
293 | |
|
294 | |
|
295 | |
|
296 | |
Element response; |
297 | |
try { |
298 | 1746 | response = transport.send(request, endPointURI); |
299 | 0 | } catch (TransportException te) { |
300 | 0 | throw new RegistryException(te); |
301 | 1746 | } |
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
|
310 | |
|
311 | |
|
312 | |
|
313 | |
|
314 | |
|
315 | |
|
316 | |
|
317 | 1746 | if (response.getNamespaceURI()==null) { |
318 | 0 | response.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns", this.getUddiNamespace()); |
319 | |
} |
320 | |
|
321 | |
|
322 | |
|
323 | |
|
324 | |
|
325 | |
|
326 | 1746 | String responseName = response.getLocalName(); |
327 | 1746 | if (responseName == null) { |
328 | 0 | throw new RegistryException("Unsupported response " |
329 | |
+ "from registry. A value was not present."); |
330 | |
} |
331 | |
|
332 | |
|
333 | |
|
334 | |
|
335 | |
|
336 | |
|
337 | |
|
338 | |
|
339 | |
|
340 | |
|
341 | |
|
342 | 1746 | JAXBElement<?> uddiResponse = null; |
343 | |
try { |
344 | 1746 | String xml = XMLUtils.convertNodeToXMLString(response); |
345 | 1746 | log.debug("Response is: " + xml); |
346 | |
|
347 | 1746 | StringReader reader = new StringReader(xml); |
348 | 1746 | uddiResponse = (JAXBElement<?>) unmarshaller.unmarshal(new StreamSource(reader)); |
349 | |
|
350 | |
|
351 | |
|
352 | 0 | } catch (JAXBException xmle) { |
353 | 0 | throw (new RegistryException(xmle)); |
354 | 1746 | } |
355 | |
|
356 | 1746 | if (responseName.toLowerCase().equals("fault")) { |
357 | 0 | NodeList nodeList = null; |
358 | |
|
359 | |
|
360 | 0 | String fCode = null; |
361 | 0 | nodeList = response.getElementsByTagName("faultcode"); |
362 | 0 | if (nodeList.getLength() > 0) |
363 | 0 | fCode = nodeList.item(0).getNodeValue(); |
364 | |
|
365 | 0 | String fString = null; |
366 | 0 | nodeList = response.getElementsByTagName("faultstring"); |
367 | 0 | if (nodeList.getLength() > 0) |
368 | 0 | fString = nodeList.item(0).getNodeValue(); |
369 | |
|
370 | 0 | String fActor = null; |
371 | 0 | nodeList = response.getElementsByTagName("faultactor"); |
372 | 0 | if (nodeList.getLength() > 0) |
373 | 0 | fActor = nodeList.item(0).getNodeValue(); |
374 | |
|
375 | 0 | DispositionReport dispRpt = null; |
376 | |
|
377 | 0 | nodeList = response.getElementsByTagName("detail"); |
378 | 0 | if (nodeList.getLength() > 0) { |
379 | 0 | nodeList = ((Element) nodeList.item(0)) |
380 | |
.getElementsByTagName("dispositionReport"); |
381 | 0 | if (nodeList.getLength() > 0) { |
382 | 0 | JAXBElement<DispositionReport> dispRptObj = null; |
383 | |
try { |
384 | 0 | dispRptObj = (JAXBElement<DispositionReport>) unmarshaller.unmarshal((Element) nodeList |
385 | |
.item(0)); |
386 | 0 | } catch (JAXBException xmle) { |
387 | 0 | throw (new RegistryException(xmle)); |
388 | 0 | } |
389 | 0 | dispRpt = dispRptObj.getValue(); |
390 | |
} |
391 | |
} |
392 | |
|
393 | 0 | RegistryException e = new RegistryException(fCode, fString, fActor, dispRpt); |
394 | |
|
395 | |
|
396 | 0 | throw e; |
397 | |
} |
398 | |
|
399 | 1746 | return uddiResponse; |
400 | |
} |
401 | |
|
402 | |
|
403 | |
|
404 | |
|
405 | |
public URI getAdminURI() { |
406 | 0 | return this.adminURI; |
407 | |
} |
408 | |
|
409 | |
|
410 | |
|
411 | |
|
412 | |
|
413 | |
public void setAdminURI(URI url) { |
414 | 348 | this.adminURI = url; |
415 | 348 | } |
416 | |
|
417 | |
|
418 | |
|
419 | |
|
420 | |
public URI getInquiryURI() { |
421 | 510 | return this.inquiryURI; |
422 | |
} |
423 | |
|
424 | |
|
425 | |
|
426 | |
|
427 | |
|
428 | |
public void setInquiryURI(URI inquiryURI) { |
429 | 696 | this.inquiryURI = inquiryURI; |
430 | 696 | } |
431 | |
|
432 | |
|
433 | |
|
434 | |
|
435 | |
public String getProtocolHandler() { |
436 | 0 | return this.protocolHandler; |
437 | |
} |
438 | |
|
439 | |
|
440 | |
|
441 | |
|
442 | |
|
443 | |
public void setProtocolHandler(String protocolHandler) { |
444 | 348 | this.protocolHandler = protocolHandler; |
445 | 348 | } |
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
public URI getPublishURI() { |
451 | 1236 | return this.publishURI; |
452 | |
} |
453 | |
|
454 | |
|
455 | |
|
456 | |
|
457 | |
public URI getSecurityURI() { |
458 | 0 | return this.securityURI; |
459 | |
} |
460 | |
|
461 | |
|
462 | |
|
463 | |
|
464 | |
|
465 | |
public void setPublishURI(URI publishURI) { |
466 | 696 | this.publishURI = publishURI; |
467 | 696 | } |
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
public void setSecurityURI(URI securityURI) { |
474 | 696 | this.securityURI = securityURI; |
475 | 696 | } |
476 | |
|
477 | |
|
478 | |
|
479 | |
|
480 | |
public String getSecurityProvider() { |
481 | 0 | return this.securityProvider; |
482 | |
} |
483 | |
|
484 | |
|
485 | |
|
486 | |
|
487 | |
|
488 | |
public void setSecurityProvider(String securityProvider) { |
489 | 348 | this.securityProvider = securityProvider; |
490 | 348 | } |
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
public Transport getTransport() { |
496 | 0 | return transport; |
497 | |
} |
498 | |
|
499 | |
|
500 | |
|
501 | |
|
502 | |
|
503 | |
public void setTransport(Transport transport) { |
504 | 348 | this.transport = transport; |
505 | 348 | } |
506 | |
|
507 | |
|
508 | |
|
509 | |
|
510 | |
public String getUddiNamespace() { |
511 | 1746 | return this.uddiNamespace; |
512 | |
} |
513 | |
|
514 | |
|
515 | |
|
516 | |
|
517 | |
|
518 | |
public void setUddiNamespace(String uddiNS) { |
519 | 348 | this.uddiNamespace = uddiNS; |
520 | 348 | } |
521 | |
|
522 | |
|
523 | |
|
524 | |
|
525 | |
public String getUddiVersion() { |
526 | 3492 | return this.uddiVersion; |
527 | |
} |
528 | |
|
529 | |
|
530 | |
|
531 | |
|
532 | |
|
533 | |
public void setUddiVersion(String uddiVersion) { |
534 | 348 | this.uddiVersion = uddiVersion; |
535 | 348 | } |
536 | |
|
537 | |
|
538 | |
|
539 | |
|
540 | |
|
541 | |
|
542 | |
|
543 | |
public DispositionReport deleteBinding(String authInfo, |
544 | |
String[] bindingKeyArray) throws RegistryException { |
545 | 18 | DeleteBinding request = this.objectFactory.createDeleteBinding(); |
546 | |
|
547 | 18 | if (authInfo != null) { |
548 | 18 | request.setAuthInfo(authInfo); |
549 | |
} |
550 | |
|
551 | 18 | if (bindingKeyArray != null) { |
552 | 18 | request.getBindingKey().addAll(Arrays.asList(bindingKeyArray)); |
553 | |
} |
554 | |
|
555 | |
DispositionReport dr; |
556 | 18 | JAXBElement<?> o = execute(this.objectFactory.createDeleteBinding(request), this.getPublishURI()); |
557 | 18 | dr = (DispositionReport) o.getValue(); |
558 | |
|
559 | 18 | return dr; |
560 | |
} |
561 | |
|
562 | |
|
563 | |
|
564 | |
|
565 | |
|
566 | |
|
567 | |
public DispositionReport deleteBusiness(String authInfo, |
568 | |
String[] businessKeyArray) throws RegistryException { |
569 | 84 | DeleteBusiness request = this.objectFactory.createDeleteBusiness(); |
570 | |
|
571 | 84 | if (authInfo != null) { |
572 | 84 | request.setAuthInfo(authInfo); |
573 | |
} |
574 | |
|
575 | 84 | if (businessKeyArray != null) { |
576 | 84 | request.getBusinessKey().addAll(Arrays.asList(businessKeyArray)); |
577 | |
} |
578 | |
|
579 | |
DispositionReport dr; |
580 | 84 | JAXBElement<?> o = execute(this.objectFactory.createDeleteBusiness(request), this.getPublishURI()); |
581 | 84 | dr = (DispositionReport) o.getValue(); |
582 | |
|
583 | 84 | return dr; |
584 | |
} |
585 | |
|
586 | |
|
587 | |
|
588 | |
|
589 | |
public DispositionReport deletePublisherAssertions(String authInfo, |
590 | |
PublisherAssertion[] assertionArray) throws RegistryException { |
591 | 96 | DeletePublisherAssertions request = this.objectFactory.createDeletePublisherAssertions(); |
592 | |
|
593 | 96 | if (authInfo != null) { |
594 | 96 | request.setAuthInfo(authInfo); |
595 | |
} |
596 | |
|
597 | 96 | if (assertionArray != null) { |
598 | 96 | request.getPublisherAssertion().addAll(Arrays.asList(assertionArray)); |
599 | |
} |
600 | |
|
601 | |
DispositionReport dr; |
602 | 96 | JAXBElement<?> o = execute(this.objectFactory.createDeletePublisherAssertions(request), |
603 | |
this.getPublishURI()); |
604 | 96 | dr = (DispositionReport) o.getValue(); |
605 | |
|
606 | 96 | return dr; |
607 | |
} |
608 | |
|
609 | |
|
610 | |
|
611 | |
|
612 | |
|
613 | |
|
614 | |
|
615 | |
public DispositionReport deleteService(String authInfo, |
616 | |
String[] serviceKeyArray) throws RegistryException { |
617 | 36 | DeleteService request = this.objectFactory.createDeleteService(); |
618 | |
|
619 | 36 | if (authInfo != null) { |
620 | 36 | request.setAuthInfo(authInfo); |
621 | |
} |
622 | |
|
623 | 36 | if (serviceKeyArray != null) { |
624 | 36 | request.getServiceKey().addAll(Arrays.asList(serviceKeyArray)); |
625 | |
} |
626 | |
|
627 | |
DispositionReport dr; |
628 | 36 | JAXBElement<?> o = execute(this.objectFactory.createDeleteService(request), |
629 | |
this.getPublishURI()); |
630 | 36 | dr = (DispositionReport) o.getValue(); |
631 | |
|
632 | 36 | return dr; |
633 | |
} |
634 | |
|
635 | |
|
636 | |
|
637 | |
|
638 | |
|
639 | |
|
640 | |
|
641 | |
|
642 | |
public DispositionReport deleteTModel(String authInfo, |
643 | |
String[] tModelKeyArray) throws RegistryException { |
644 | 36 | DeleteTModel request = this.objectFactory.createDeleteTModel(); |
645 | |
|
646 | 36 | if (authInfo != null) { |
647 | 36 | request.setAuthInfo(authInfo); |
648 | |
} |
649 | |
|
650 | 36 | if (tModelKeyArray != null) { |
651 | 36 | request.getTModelKey().addAll(Arrays.asList(tModelKeyArray)); |
652 | |
} |
653 | |
|
654 | |
DispositionReport dr; |
655 | 36 | JAXBElement<?> o = execute(this.objectFactory.createDeleteTModel(request), |
656 | |
this.getPublishURI()); |
657 | 36 | dr = (DispositionReport) o.getValue(); |
658 | |
|
659 | 36 | return dr; |
660 | |
} |
661 | |
|
662 | |
|
663 | |
|
664 | |
|
665 | |
|
666 | |
|
667 | |
|
668 | |
public BusinessList findBusiness(Name[] nameArray, |
669 | |
DiscoveryURLs discoveryURLs, IdentifierBag identifierBag, |
670 | |
CategoryBag categoryBag, TModelBag tModelBag, |
671 | |
FindQualifiers findQualifiers, int maxRows) |
672 | |
throws RegistryException { |
673 | 66 | FindBusiness request = this.objectFactory.createFindBusiness(); |
674 | |
|
675 | 66 | if (nameArray != null) { |
676 | 66 | request.getName().addAll(Arrays.asList(nameArray)); |
677 | |
} |
678 | |
|
679 | 66 | if (discoveryURLs != null) { |
680 | 0 | request.setDiscoveryURLs(discoveryURLs); |
681 | |
} |
682 | |
|
683 | 66 | if (identifierBag != null) { |
684 | 0 | request.setIdentifierBag(identifierBag); |
685 | |
} |
686 | |
|
687 | 66 | if (categoryBag != null) { |
688 | 0 | request.setCategoryBag(categoryBag); |
689 | |
} |
690 | |
|
691 | 66 | if (tModelBag != null) { |
692 | 0 | request.setTModelBag(tModelBag); |
693 | |
} else { |
694 | 66 | request.setTModelBag(this.objectFactory.createTModelBag()); |
695 | |
} |
696 | |
|
697 | 66 | if (findQualifiers != null) { |
698 | 66 | request.setFindQualifiers(findQualifiers); |
699 | |
} |
700 | |
|
701 | 66 | request.setMaxRows(maxRows); |
702 | |
|
703 | |
BusinessList bl; |
704 | 66 | JAXBElement<?> o = execute(this.objectFactory.createFindBusiness(request), |
705 | |
this.getInquiryURI()); |
706 | 66 | bl = (BusinessList) o.getValue(); |
707 | |
|
708 | 66 | return bl; |
709 | |
} |
710 | |
|
711 | |
|
712 | |
|
713 | |
|
714 | |
|
715 | |
|
716 | |
|
717 | |
public BindingDetail findBinding(String serviceKey, |
718 | |
CategoryBag categoryBag, TModelBag tModelBag, |
719 | |
FindQualifiers findQualifiers, int maxRows) |
720 | |
throws RegistryException { |
721 | |
|
722 | |
|
723 | |
|
724 | |
|
725 | |
|
726 | |
|
727 | 12 | FindBinding request = this.objectFactory.createFindBinding(); |
728 | |
|
729 | 12 | if (serviceKey != null) { |
730 | 12 | request.setServiceKey(serviceKey); |
731 | |
} |
732 | |
|
733 | 12 | if (tModelBag != null) { |
734 | 6 | request.setTModelBag(tModelBag); |
735 | |
} else { |
736 | 6 | TModelBag tmb = this.objectFactory.createTModelBag(); |
737 | 6 | request.setTModelBag(tmb); |
738 | |
} |
739 | |
|
740 | 12 | if (findQualifiers != null) { |
741 | 12 | request.setFindQualifiers(findQualifiers); |
742 | |
} |
743 | 12 | request.setMaxRows(maxRows); |
744 | |
|
745 | |
BindingDetail bd; |
746 | 12 | JAXBElement<?> o = execute(this.objectFactory.createFindBinding(request), |
747 | |
this.getInquiryURI()); |
748 | 12 | bd = (BindingDetail) o.getValue(); |
749 | |
|
750 | 12 | return bd; |
751 | |
} |
752 | |
|
753 | |
|
754 | |
|
755 | |
|
756 | |
|
757 | |
|
758 | |
|
759 | |
|
760 | |
|
761 | |
public ServiceList findService(String businessKey, Name[] nameArray, |
762 | |
CategoryBag categoryBag, TModelBag tModelBag, |
763 | |
FindQualifiers findQualifiers, int maxRows) |
764 | |
throws RegistryException { |
765 | 30 | FindService request = this.objectFactory.createFindService(); |
766 | |
|
767 | 30 | if (businessKey != null) { |
768 | 6 | request.setBusinessKey(businessKey); |
769 | |
} |
770 | |
|
771 | 30 | if (nameArray != null) { |
772 | 30 | request.getName().addAll(Arrays.asList(nameArray)); |
773 | |
} |
774 | |
|
775 | 30 | if (categoryBag != null) { |
776 | 18 | request.setCategoryBag(categoryBag); |
777 | |
} |
778 | |
|
779 | 30 | if (tModelBag != null) { |
780 | 0 | request.setTModelBag(tModelBag); |
781 | |
} |
782 | |
|
783 | 30 | if (findQualifiers != null) { |
784 | 24 | request.setFindQualifiers(findQualifiers); |
785 | |
} |
786 | |
|
787 | 30 | request.setMaxRows(maxRows); |
788 | |
|
789 | |
ServiceList sl; |
790 | 30 | JAXBElement<?> o = execute(this.objectFactory.createFindService(request), |
791 | |
this.getInquiryURI()); |
792 | 30 | sl = (ServiceList) o.getValue(); |
793 | |
|
794 | 30 | return sl; |
795 | |
} |
796 | |
|
797 | |
|
798 | |
|
799 | |
|
800 | |
|
801 | |
|
802 | |
|
803 | |
public TModelList findTModel(String name, CategoryBag categoryBag, |
804 | |
IdentifierBag identifierBag, FindQualifiers findQualifiers, |
805 | |
int maxRows) throws RegistryException { |
806 | 60 | FindTModel request = this.objectFactory.createFindTModel(); |
807 | |
|
808 | 60 | Name jaxbName = this.objectFactory.createName(); |
809 | |
|
810 | 60 | if (name != null) { |
811 | 60 | jaxbName.setValue(name); |
812 | |
} |
813 | |
|
814 | 60 | request.setName(jaxbName); |
815 | |
|
816 | 60 | if (categoryBag != null) { |
817 | 0 | request.setCategoryBag(categoryBag); |
818 | |
} |
819 | |
|
820 | 60 | if (identifierBag != null) { |
821 | 0 | request.setIdentifierBag(identifierBag); |
822 | |
} |
823 | |
|
824 | 60 | if (findQualifiers != null) { |
825 | 60 | request.setFindQualifiers(findQualifiers); |
826 | |
} |
827 | |
|
828 | 60 | request.setMaxRows(maxRows); |
829 | |
|
830 | |
TModelList tml; |
831 | 60 | JAXBElement<?> o = execute(this.objectFactory.createFindTModel(request), |
832 | |
this.getInquiryURI()); |
833 | 60 | tml = (TModelList) o.getValue(); |
834 | |
|
835 | 60 | return tml; |
836 | |
} |
837 | |
|
838 | |
|
839 | |
|
840 | |
|
841 | |
public AssertionStatusReport getAssertionStatusReport(String authInfo, |
842 | |
String completionStatus) throws RegistryException { |
843 | 270 | GetAssertionStatusReport request = this.objectFactory.createGetAssertionStatusReport(); |
844 | |
|
845 | 270 | if (authInfo != null) { |
846 | 270 | request.setAuthInfo(authInfo); |
847 | |
} |
848 | |
|
849 | 270 | if (completionStatus != null) { |
850 | 270 | request.setCompletionStatus(completionStatus); |
851 | |
} |
852 | |
|
853 | |
AssertionStatusReport asr; |
854 | 270 | JAXBElement<?> o = execute(this.objectFactory.createGetAssertionStatusReport(request), |
855 | |
this.getPublishURI()); |
856 | 270 | asr = (AssertionStatusReport) o.getValue(); |
857 | |
|
858 | 270 | return asr; |
859 | |
} |
860 | |
|
861 | |
|
862 | |
|
863 | |
|
864 | |
|
865 | |
|
866 | |
|
867 | |
|
868 | |
|
869 | |
public AuthToken getAuthToken(String userID, String cred) |
870 | |
throws RegistryException { |
871 | 450 | GetAuthToken request = this.objectFactory.createGetAuthToken(); |
872 | |
|
873 | 450 | if (userID != null) { |
874 | 450 | request.setUserID(userID); |
875 | |
} |
876 | |
|
877 | 450 | if (cred != null) { |
878 | 450 | request.setCred(cred); |
879 | |
} |
880 | |
|
881 | 450 | URI getAuthTokenURI = null; |
882 | 450 | if ("3.0".equals(uddiVersion)) { |
883 | 0 | getAuthTokenURI = this.getSecurityURI(); |
884 | |
} else { |
885 | 450 | getAuthTokenURI = this.getPublishURI(); |
886 | |
} |
887 | |
|
888 | |
AuthToken at; |
889 | 450 | JAXBElement<?> o = execute(this.objectFactory.createGetAuthToken(request), |
890 | |
getAuthTokenURI); |
891 | 450 | at = (AuthToken) o.getValue(); |
892 | |
|
893 | 450 | return at; |
894 | |
} |
895 | |
|
896 | |
|
897 | |
|
898 | |
|
899 | |
|
900 | |
|
901 | |
|
902 | |
public BusinessDetail getBusinessDetail(String businessKey) |
903 | |
throws RegistryException { |
904 | 276 | String[] keys = new String[1]; |
905 | 276 | keys[0] = businessKey; |
906 | |
|
907 | 276 | return getBusinessDetail(keys); |
908 | |
} |
909 | |
|
910 | |
|
911 | |
|
912 | |
|
913 | |
|
914 | |
|
915 | |
|
916 | |
public BusinessDetail getBusinessDetail(String[] businessKeyArray) |
917 | |
throws RegistryException { |
918 | 276 | GetBusinessDetail request = this.objectFactory.createGetBusinessDetail(); |
919 | |
|
920 | 276 | if (businessKeyArray != null) { |
921 | 276 | request.getBusinessKey().addAll(Arrays.asList(businessKeyArray)); |
922 | |
} |
923 | |
|
924 | |
BusinessDetail bd; |
925 | 276 | JAXBElement<?> o = execute(this.objectFactory.createGetBusinessDetail(request), |
926 | |
this.getInquiryURI()); |
927 | 276 | bd = (BusinessDetail) o.getValue(); |
928 | 276 | return bd; |
929 | |
} |
930 | |
|
931 | |
|
932 | |
|
933 | |
|
934 | |
public PublisherAssertions getPublisherAssertions(String authInfo) |
935 | |
throws RegistryException { |
936 | 6 | GetPublisherAssertions request = this.objectFactory.createGetPublisherAssertions(); |
937 | |
|
938 | 6 | if (authInfo != null) { |
939 | 6 | request.setAuthInfo(authInfo); |
940 | |
} |
941 | |
|
942 | |
PublisherAssertions pa; |
943 | 6 | JAXBElement<?> o = execute(this.objectFactory.createGetPublisherAssertions(request), |
944 | |
this.getPublishURI()); |
945 | 6 | pa = (PublisherAssertions) o.getValue(); |
946 | |
|
947 | 6 | return pa; |
948 | |
} |
949 | |
|
950 | |
|
951 | |
|
952 | |
|
953 | |
public RegisteredInfo getRegisteredInfo(String authInfo) |
954 | |
throws RegistryException { |
955 | 24 | GetRegisteredInfo request = this.objectFactory.createGetRegisteredInfo(); |
956 | |
|
957 | 24 | if (authInfo != null) { |
958 | 24 | request.setAuthInfo(authInfo); |
959 | |
} |
960 | |
|
961 | |
RegisteredInfo ri; |
962 | 24 | JAXBElement<?> o = execute(this.objectFactory.createGetRegisteredInfo(request), |
963 | |
this.getPublishURI()); |
964 | 24 | ri = (RegisteredInfo) o.getValue(); |
965 | |
|
966 | 24 | return ri; |
967 | |
} |
968 | |
|
969 | |
|
970 | |
|
971 | |
|
972 | |
|
973 | |
|
974 | |
|
975 | |
public ServiceDetail getServiceDetail(String serviceKey) |
976 | |
throws RegistryException { |
977 | 48 | String[] keys = new String[1]; |
978 | 48 | keys[0] = serviceKey; |
979 | |
|
980 | 48 | return getServiceDetail(keys); |
981 | |
} |
982 | |
|
983 | |
|
984 | |
|
985 | |
|
986 | |
|
987 | |
|
988 | |
|
989 | |
public ServiceDetail getServiceDetail(String[] serviceKeyArray) |
990 | |
throws RegistryException { |
991 | 48 | GetServiceDetail request = this.objectFactory.createGetServiceDetail(); |
992 | |
|
993 | 48 | if (serviceKeyArray != null) { |
994 | 48 | request.getServiceKey().addAll(Arrays.asList(serviceKeyArray)); |
995 | |
} |
996 | |
|
997 | |
ServiceDetail sd; |
998 | 48 | JAXBElement<?> o = execute(this.objectFactory.createGetServiceDetail(request), |
999 | |
this.getInquiryURI()); |
1000 | 48 | sd = (ServiceDetail) o.getValue(); |
1001 | |
|
1002 | 48 | return sd; |
1003 | |
} |
1004 | |
|
1005 | |
|
1006 | |
|
1007 | |
|
1008 | |
|
1009 | |
|
1010 | |
|
1011 | |
public TModelDetail getTModelDetail(String tModelKey) |
1012 | |
throws RegistryException { |
1013 | 18 | String[] keys = new String[1]; |
1014 | 18 | keys[0] = tModelKey; |
1015 | |
|
1016 | 18 | return getTModelDetail(keys); |
1017 | |
} |
1018 | |
|
1019 | |
|
1020 | |
|
1021 | |
|
1022 | |
|
1023 | |
|
1024 | |
|
1025 | |
public TModelDetail getTModelDetail(String[] tModelKeyArray) |
1026 | |
throws RegistryException { |
1027 | 18 | GetTModelDetail request = this.objectFactory.createGetTModelDetail(); |
1028 | |
|
1029 | 18 | if (tModelKeyArray != null) { |
1030 | 18 | request.getTModelKey().addAll(Arrays.asList(tModelKeyArray)); |
1031 | |
} |
1032 | |
|
1033 | |
TModelDetail tmd; |
1034 | 18 | JAXBElement<?> o = execute(this.objectFactory.createGetTModelDetail(request), |
1035 | |
this.getInquiryURI()); |
1036 | 18 | tmd = (TModelDetail) o.getValue(); |
1037 | |
|
1038 | 18 | return tmd; |
1039 | |
} |
1040 | |
|
1041 | |
|
1042 | |
|
1043 | |
|
1044 | |
public PublisherAssertions setPublisherAssertions(String authInfo, |
1045 | |
PublisherAssertion[] assertionArray) throws RegistryException { |
1046 | 24 | SetPublisherAssertions request = this.objectFactory.createSetPublisherAssertions(); |
1047 | |
|
1048 | 24 | if (authInfo != null) { |
1049 | 24 | request.setAuthInfo(authInfo); |
1050 | |
} |
1051 | |
|
1052 | 24 | if (assertionArray != null) { |
1053 | 24 | request.getPublisherAssertion().addAll(Arrays.asList(assertionArray)); |
1054 | |
} |
1055 | |
|
1056 | |
PublisherAssertions pa; |
1057 | 24 | JAXBElement<?> o = execute(this.objectFactory.createSetPublisherAssertions(request), |
1058 | |
this.getPublishURI()); |
1059 | 24 | pa = (PublisherAssertions) o.getValue(); |
1060 | |
|
1061 | 24 | return pa; |
1062 | |
} |
1063 | |
|
1064 | |
|
1065 | |
|
1066 | |
|
1067 | |
|
1068 | |
|
1069 | |
|
1070 | |
|
1071 | |
public BindingDetail saveBinding(String authInfo, |
1072 | |
BindingTemplate[] bindingArray) throws RegistryException { |
1073 | 24 | SaveBinding request = this.objectFactory.createSaveBinding(); |
1074 | |
|
1075 | 24 | if (authInfo != null) { |
1076 | 24 | request.setAuthInfo(authInfo); |
1077 | |
} |
1078 | |
|
1079 | 24 | if (bindingArray != null) { |
1080 | 24 | request.getBindingTemplate().addAll(Arrays.asList(bindingArray)); |
1081 | |
} |
1082 | |
|
1083 | |
BindingDetail bd; |
1084 | 24 | JAXBElement<?> o = execute(this.objectFactory.createSaveBinding(request), |
1085 | |
this.getPublishURI()); |
1086 | 24 | bd = (BindingDetail) o.getValue(); |
1087 | |
|
1088 | 24 | return bd; |
1089 | |
} |
1090 | |
|
1091 | |
|
1092 | |
|
1093 | |
|
1094 | |
|
1095 | |
|
1096 | |
|
1097 | |
|
1098 | |
|
1099 | |
public BusinessDetail saveBusiness(String authInfo, |
1100 | |
BusinessEntity[] businessArray) throws RegistryException { |
1101 | 90 | SaveBusiness request = this.objectFactory.createSaveBusiness(); |
1102 | |
|
1103 | 90 | if (authInfo != null) { |
1104 | 90 | request.setAuthInfo(authInfo); |
1105 | |
} |
1106 | |
|
1107 | 90 | if (businessArray != null) { |
1108 | 90 | request.getBusinessEntity().addAll(Arrays.asList(businessArray)); |
1109 | |
} |
1110 | |
|
1111 | |
BusinessDetail bd; |
1112 | 90 | JAXBElement<?> o = execute(this.objectFactory.createSaveBusiness(request), |
1113 | |
this.getPublishURI()); |
1114 | 90 | bd = (BusinessDetail) o.getValue(); |
1115 | |
|
1116 | 90 | return bd; |
1117 | |
} |
1118 | |
|
1119 | |
|
1120 | |
|
1121 | |
|
1122 | |
|
1123 | |
|
1124 | |
|
1125 | |
public ServiceDetail saveService(String authInfo, |
1126 | |
BusinessService[] serviceArray) throws RegistryException { |
1127 | 36 | SaveService request = this.objectFactory.createSaveService(); |
1128 | |
|
1129 | 36 | if (authInfo != null) { |
1130 | 36 | request.setAuthInfo(authInfo); |
1131 | |
} |
1132 | |
|
1133 | 36 | if (serviceArray != null) { |
1134 | 36 | request.getBusinessService().addAll(Arrays.asList(serviceArray)); |
1135 | |
} |
1136 | |
|
1137 | |
ServiceDetail sd; |
1138 | 36 | JAXBElement<?> o = execute(this.objectFactory.createSaveService(request), |
1139 | |
this.getPublishURI()); |
1140 | 36 | sd = (ServiceDetail) o.getValue(); |
1141 | |
|
1142 | 36 | return sd; |
1143 | |
} |
1144 | |
|
1145 | |
|
1146 | |
|
1147 | |
|
1148 | |
|
1149 | |
|
1150 | |
public TModelDetail saveTModel(String authInfo, TModel[] tModelArray) |
1151 | |
throws RegistryException { |
1152 | 42 | SaveTModel request = this.objectFactory.createSaveTModel(); |
1153 | |
|
1154 | 42 | if (authInfo != null) { |
1155 | 42 | request.setAuthInfo(authInfo); |
1156 | |
} |
1157 | |
|
1158 | 42 | if (tModelArray != null) { |
1159 | 42 | request.getTModel().addAll(Arrays.asList(tModelArray)); |
1160 | |
} |
1161 | |
|
1162 | |
TModelDetail tmd; |
1163 | 42 | JAXBElement<?> o = execute(this.objectFactory.createSaveTModel(request), |
1164 | |
this.getPublishURI()); |
1165 | 42 | tmd = (TModelDetail) o.getValue(); |
1166 | 42 | return tmd; |
1167 | |
} |
1168 | |
|
1169 | |
|
1170 | |
|
1171 | |
|
1172 | |
|
1173 | |
|
1174 | |
|
1175 | |
|
1176 | |
public Transport getTransport(String className) { |
1177 | 348 | Transport transport = null; |
1178 | 348 | Class transportClass = null; |
1179 | |
|
1180 | |
|
1181 | |
|
1182 | 348 | if (className == null) |
1183 | 0 | className = DEFAULT_TRANSPORT_CLASS; |
1184 | |
|
1185 | |
try { |
1186 | |
|
1187 | 348 | transportClass = getClassForName(className); |
1188 | 0 | } catch (ClassNotFoundException cnfex) { |
1189 | 0 | throw new RuntimeException(cnfex); |
1190 | 348 | } |
1191 | |
|
1192 | |
try { |
1193 | |
|
1194 | 348 | transport = (Transport) transportClass.newInstance(); |
1195 | 0 | } catch (Exception ex) { |
1196 | 0 | throw new RuntimeException(ex); |
1197 | 348 | } |
1198 | |
|
1199 | 348 | return transport; |
1200 | |
} |
1201 | |
|
1202 | |
|
1203 | |
|
1204 | |
|
1205 | |
|
1206 | |
|
1207 | |
|
1208 | |
|
1209 | |
public static Class getClassForName(String name) |
1210 | |
throws ClassNotFoundException, NoClassDefFoundError { |
1211 | 348 | Class clazz = null; |
1212 | |
|
1213 | |
try { |
1214 | |
|
1215 | 348 | ClassLoader ccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() |
1216 | |
{ |
1217 | 696 | public ClassLoader run() { |
1218 | 348 | return Thread.currentThread().getContextClassLoader(); |
1219 | |
} |
1220 | |
}); |
1221 | |
|
1222 | 348 | clazz = Class.forName(name, true, ccl); |
1223 | 0 | } catch (Exception e) { |
1224 | 0 | log.debug("Failed to load the class " + name + " with context class loader " + e); |
1225 | 348 | } |
1226 | |
|
1227 | 348 | if (null == clazz) { |
1228 | 0 | ClassLoader scl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() |
1229 | |
{ |
1230 | 0 | public ClassLoader run() { |
1231 | 0 | return ClassLoader.getSystemClassLoader(); |
1232 | |
} |
1233 | |
}); |
1234 | |
|
1235 | |
try { |
1236 | 0 | clazz = Class.forName(name, true, scl); |
1237 | 0 | } catch (Exception e) { |
1238 | 0 | throw new RuntimeException(e); |
1239 | 0 | } |
1240 | |
} |
1241 | |
|
1242 | 348 | return clazz; |
1243 | |
} |
1244 | |
} |