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