VirtualBox

source: vbox/trunk/src/VBox/Main/webservice/glue-jaxws.xsl@ 18703

Last change on this file since 18703 was 18694, checked in by vboxsync, 16 years ago

SDK licensing

  • Property svn:eol-style set to native
File size: 49.1 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 websrv-jax-ws.xsl:
5 XSLT stylesheet that generates virtualbox.java from
6 VirtualBox.xidl. This generated Java code contains
7 a Java wrapper that allows client code to use the
8 webservice in an object-oriented way.
9
10 Copyright (C) 2006-2008 Sun Microsystems, Inc.
11
12 This file is part of VirtualBox Open Source Edition (OSE), as
13 available from http://www.virtualbox.org. This file is free software;
14 you can redistribute it and/or modify it under the terms of the GNU
15 General Public License (GPL) as published by the Free Software
16 Foundation, in version 2 as it comes in the "COPYING" file of the
17 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
20 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
21 Clara, CA 95054 USA or visit http://www.sun.com if you need
22 additional information or have any questions.
23-->
24
25<xsl:stylesheet
26 version="1.0"
27 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
29 xmlns:exsl="http://exslt.org/common"
30 extension-element-prefixes="exsl">
31
32 <xsl:output method="text"/>
33
34 <xsl:strip-space elements="*"/>
35
36<!-- - - - - - - - - - - - - - - - - - - - - - -
37 global XSLT variables
38 - - - - - - - - - - - - - - - - - - - - - - -->
39
40<xsl:variable name="G_xsltFilename" select="'glue-jaxws.xsl'" />
41<!-- Keep in sync with VBOX_JAVA_PACKAGE in webservices/Makefile.kmk -->
42<xsl:variable name="G_virtualBoxPackage" select="concat('org.virtualbox',$G_vboxApiSuffix)" />
43<xsl:variable name="G_virtualBoxPackage2" select="concat('com.sun.xml.ws.commons.virtualbox',$G_vboxApiSuffix)" />
44
45<xsl:include href="websrv-shared.inc.xsl" />
46
47<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
48 quick lookup -->
49<xsl:variable name="G_setSuppressedInterfaces"
50 select="//interface[@wsmap='suppress']" />
51
52
53<xsl:template name="fileheader">
54 <xsl:param name="name" />
55 <xsl:text>/**
56 * Copyright (C) 2008-2009 Sun Microsystems, Inc.
57 *
58 * This file is part of a free software library; you can redistribute
59 * it and/or modify it under the terms of the GNU Lesser General
60 * Public License version 2.1 as published by the Free Software
61 * Foundation and shipped in the "COPYING.LIB" file with this library.
62 * The library is distributed in the hope that it will be useful,
63 * but WITHOUT ANY WARRANTY of any kind.
64 *
65 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if
66 * any license choice other than GPL or LGPL is available it will
67 * apply instead, Sun elects to use only the Lesser General Public
68 * License version 2.1 (LGPLv2) at this time for any software where
69 * a choice of LGPL license versions is made available with the
70 * language indicating that LGPLv2 or any later version may be used,
71 * or where a choice of which version of the LGPL is applied is
72 * otherwise unspecified.
73 *
74 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
75 * Clara, CA 95054 USA or visit http://www.sun.com if you need
76 * additional information or have any questions.
77 *
78</xsl:text>
79 <xsl:value-of select="concat(' * ',$name)"/>
80<xsl:text>
81 *
82 * DO NOT EDIT! This is a generated file.
83 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
84 * Generator: src/VBox/Main/webservice/glue-jaxws.xsl
85 */
86
87</xsl:text>
88</xsl:template>
89
90<xsl:template name="fullClassName">
91 <xsl:param name="name" />
92 <xsl:param name="origname" />
93 <xsl:param name="collPrefix" />
94 <xsl:variable name="coll" select="//collection[@name=$name]" />
95 <xsl:choose>
96 <xsl:when test="//collection[@name=$name]">
97 <!-- for collections and safearrays we return element type -->
98 <xsl:call-template name="fullClassName">
99 <xsl:with-param name="name" select="concat($collPrefix,//collection[@name=$name]/@type)" />
100 <xsl:with-param name="origname" select="//collection[@name=$name]/@type" />
101 <xsl:with-param name="collPrefix" select="$collPrefix" />
102 </xsl:call-template>
103 <!-- <xsl:value-of select="concat('org.virtualbox.', concat($collPrefix,//collection[@name=$name]/@type))" /> -->
104 </xsl:when>
105 <xsl:when test="//enum[@name=$name] or //enum[@name=$origname]">
106 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
107 </xsl:when>
108 <xsl:when test="$collPrefix and //interface[@name=$origname]/@wsmap='managed'">
109 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
110 </xsl:when>
111 <xsl:when test="//interface[@name=$name]/@wsmap='struct' or //interface[@name=$origname]/@wsmap='struct'">
112 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
113 </xsl:when>
114 <xsl:otherwise>
115 <xsl:value-of select="concat($G_virtualBoxPackage2, concat('.', $name))" />
116 </xsl:otherwise>
117 </xsl:choose>
118</xsl:template>
119
120<!--
121 typeIdl2Glue: converts $type into a type as used by the java glue code.
122 For example, for an XIDL IMachineCollection, this will return
123 "List<com.sun.xml.ws.commons.virtualbox.IMachine>".
124 -->
125<xsl:template name="typeIdl2Glue">
126 <xsl:param name="ifname" />
127 <xsl:param name="method" />
128 <xsl:param name="name" />
129 <xsl:param name="type" />
130 <xsl:param name="safearray" />
131 <xsl:param name="forceelem" />
132
133 <xsl:variable name="needarray" select="($safearray='yes' or //collection[@name=$type]) and not($forceelem='yes')" />
134
135 <xsl:if test="$needarray">
136 <xsl:value-of select="'List&lt;'" />
137 </xsl:if>
138
139 <xsl:choose>
140 <xsl:when test="$type='wstring'">String</xsl:when>
141 <xsl:when test="$type='boolean'">Boolean</xsl:when>
142<!-- <xsl:when test="$type='double'">double</xsl:when> -->
143<!-- <xsl:when test="$type='float'">float</xsl:when> -->
144 <!-- <xsl:when test="$type='octet'">byte</xsl:when> -->
145<!-- <xsl:when test="$type='short'">short</xsl:when> -->
146 <xsl:when test="$type='unsigned short'">Integer</xsl:when>
147 <xsl:when test="$type='long'">Integer</xsl:when>
148 <xsl:when test="$type='long long'">Long</xsl:when>
149 <xsl:when test="$type='unsigned long'">Long</xsl:when>
150 <xsl:when test="$type='unsigned long long'">BigInteger</xsl:when>
151 <xsl:when test="$type='result'">Long</xsl:when>
152 <xsl:when test="$type='uuid'">UUID</xsl:when>
153 <!-- not a standard type: then it better be one of the types defined in the XIDL -->
154 <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
155 <xsl:otherwise>
156 <xsl:call-template name="fullClassName">
157 <xsl:with-param name="name" select="$type" />
158 <xsl:with-param name="collPrefix" select="''"/>
159 </xsl:call-template>
160 </xsl:otherwise>
161 <!-- <xsl:otherwise> -->
162<!-- <xsl:call-template name="fatalError"> -->
163<!-- <xsl:with-param name="msg" select="concat('typeIdl2Glue: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method, '&quot; is not supported.')" /> -->
164<!-- </xsl:call-template> -->
165<!-- </xsl:otherwise> -->
166 </xsl:choose>
167
168 <xsl:if test="$needarray">
169 <xsl:value-of select="'&gt;'" />
170 </xsl:if>
171</xsl:template>
172
173<!--
174 typeIdl2Java: converts $type into a type as used by the JAX-WS backend.
175 For example, for an XIDL IMachineCollection, this will return
176 "ArrayOfIMachine".
177 -->
178<xsl:template name="typeIdl2Java">
179 <xsl:param name="ifname" />
180 <xsl:param name="method" />
181 <xsl:param name="name" />
182 <xsl:param name="type" />
183 <xsl:param name="safearray" />
184
185 <xsl:if test="$safearray">
186 <xsl:value-of select="'List&lt;'" />
187 </xsl:if>
188
189 <xsl:choose>
190 <xsl:when test="$type='wstring'">String</xsl:when>
191 <xsl:when test="$type='boolean'">Boolean</xsl:when>
192 <!-- <xsl:when test="$type='double'">double</xsl:when> -->
193 <!-- <xsl:when test="$type='float'">float</xsl:when> -->
194 <!-- <xsl:when test="$type='octet'">byte</xsl:when> -->
195 <!-- <xsl:when test="$type='short'">short</xsl:when> -->
196 <xsl:when test="$type='unsigned short'">int</xsl:when>
197 <xsl:when test="$type='long'">Integer</xsl:when>
198 <xsl:when test="$type='long long'">Long</xsl:when>
199 <xsl:when test="$type='unsigned long'">Long</xsl:when>
200 <xsl:when test="$type='unsigned long long'">BigInteger</xsl:when>
201 <xsl:when test="$type='result'">Long</xsl:when>
202 <xsl:when test="$type='uuid'">String</xsl:when>
203 <xsl:when test="$type='$unknown'">String</xsl:when>
204 <xsl:when test="//interface[@name=$type]/@wsmap='managed'">String</xsl:when>
205 <xsl:otherwise>
206 <xsl:call-template name="fullClassName">
207 <xsl:with-param name="name" select="$type" />
208 <xsl:with-param name="collPrefix" select="'ArrayOf'"/>
209 </xsl:call-template>
210 </xsl:otherwise>
211 <!-- <xsl:otherwise> -->
212<!-- <xsl:call-template name="fatalError"> -->
213<!-- <xsl:with-param name="msg" select="concat('typeIdl2Java: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method, '&quot; is not supported.')" /> -->
214<!-- </xsl:call-template> -->
215<!-- </xsl:otherwise> -->
216 </xsl:choose>
217 <xsl:if test="$safearray">
218 <xsl:value-of select="'&gt;'" />
219 </xsl:if>
220</xsl:template>
221
222<xsl:template name="cookOutParam">
223 <xsl:param name="ifname"/>
224 <xsl:param name="methodname"/>
225 <xsl:param name="value"/>
226 <xsl:param name="idltype"/>
227 <xsl:param name="safearray"/>
228 <xsl:choose>
229 <xsl:when test="$idltype='uuid'">
230 <xsl:choose>
231 <xsl:when test="$safearray">
232 <xsl:value-of select="concat('Helper.uuidWrap(',$value,')')" />
233 </xsl:when>
234 <xsl:otherwise>
235 <xsl:value-of select="concat('UUID.fromString(',$value,')')" />
236 </xsl:otherwise>
237 </xsl:choose>
238 </xsl:when>
239 <xsl:when test="//collection[@name=$idltype]">
240 <xsl:variable name="elemtype">
241 <xsl:call-template name="typeIdl2Glue">
242 <xsl:with-param name="ifname" select="$ifname" />
243 <xsl:with-param name="method" select="$methodname" />
244 <xsl:with-param name="name" select="$value" />
245 <xsl:with-param name="type" select="$idltype" />
246 <xsl:with-param name="forceelem" select="'yes'" />
247 </xsl:call-template>
248 </xsl:variable>
249 <xsl:choose>
250 <xsl:when test="contains($elemtype, $G_virtualBoxPackage)">
251 <xsl:value-of select="concat($value,'.getArray()')" />
252 </xsl:when>
253 <xsl:otherwise>
254 <xsl:value-of select="concat('Helper.wrap(', $elemtype, '.class, port, ((',
255 $value,' == null)? null : ',$value,'.getArray()))')" />
256 </xsl:otherwise>
257 </xsl:choose>
258 </xsl:when>
259 <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
260 <xsl:choose>
261 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct' and $safearray='yes'">
262 <xsl:value-of select="concat('/* 2 */', $value)" />
263 </xsl:when>
264 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct'">
265 <xsl:value-of select="$value" />
266 </xsl:when>
267 <xsl:when test="$safearray='yes'">
268 <xsl:variable name="elemtype">
269 <xsl:call-template name="typeIdl2Glue">
270 <xsl:with-param name="ifname" select="$ifname" />
271 <xsl:with-param name="method" select="$methodname" />
272 <xsl:with-param name="name" select="$value" />
273 <xsl:with-param name="type" select="$idltype" />
274 <xsl:with-param name="safearray" select="'no'" />
275 <xsl:with-param name="forceelem" select="'yes'" />
276 </xsl:call-template>
277 </xsl:variable>
278 <xsl:value-of select="concat('Helper.wrap(',$elemtype, '.class, port, ', $value,')')"/>
279 </xsl:when>
280 <xsl:otherwise>
281 <xsl:variable name="gluetype">
282 <xsl:call-template name="typeIdl2Glue">
283 <xsl:with-param name="ifname" select="$ifname" />
284 <xsl:with-param name="method" select="$methodname" />
285 <xsl:with-param name="name" select="$value" />
286 <xsl:with-param name="type" select="$idltype" />
287 <xsl:with-param name="safearray" select="$safearray" />
288 </xsl:call-template>
289 </xsl:variable>
290 <xsl:value-of select="concat('new ', $gluetype, '(', $value,', port)')" />
291 </xsl:otherwise>
292 </xsl:choose>
293 </xsl:when>
294 <xsl:otherwise>
295 <xsl:value-of select="$value"/>
296 </xsl:otherwise>
297 </xsl:choose>
298</xsl:template>
299
300<xsl:template name="emitArgInMethodImpl">
301 <xsl:param name="paramname" select="@name" />
302 <xsl:param name="paramtype" select="@type" />
303 <!-- per-argument special type handling -->
304 <xsl:choose>
305 <xsl:when test="//interface[@name=$paramtype] or $paramtype='$unknown'">
306 <xsl:choose>
307 <xsl:when test="@dir='out'">
308 <xsl:value-of select="concat('tmp', $paramname)" />
309 </xsl:when>
310 <xsl:otherwise>
311 <xsl:choose>
312 <xsl:when test="@safearray='yes'">
313 <xsl:value-of select="concat('Helper.unwrap(',$paramname,')')"/>
314 </xsl:when>
315 <xsl:otherwise>
316 <xsl:value-of select="concat('((', $paramname, ' == null)?null:', $paramname, '.getRef())')" />
317 </xsl:otherwise>
318 </xsl:choose>
319 </xsl:otherwise>
320 </xsl:choose>
321 </xsl:when>
322 <xsl:when test="$paramtype='uuid'">
323 <xsl:value-of select="concat($paramname, '.toString()')" />
324 </xsl:when>
325 <xsl:otherwise>
326 <xsl:value-of select="$paramname" />
327 </xsl:otherwise>
328 </xsl:choose>
329 <xsl:if test="not(position()=last())">
330 <xsl:text>, </xsl:text>
331 </xsl:if>
332</xsl:template>
333
334<xsl:template name="startFile">
335 <xsl:param name="file" />
336
337 <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $file, '&quot;&#10;&#10;')" />
338 <xsl:call-template name="fileheader">
339 <xsl:with-param name="name" select="$file" />
340 </xsl:call-template>
341package <xsl:value-of select="$G_virtualBoxPackage2" />;
342
343import <xsl:value-of select="$G_virtualBoxPackage" />.VboxPortType;
344import <xsl:value-of select="$G_virtualBoxPackage" />.VboxService;
345import <xsl:value-of select="$G_virtualBoxPackage" />.InvalidObjectFaultMsg;
346import <xsl:value-of select="$G_virtualBoxPackage" />.RuntimeFaultMsg;
347import javax.xml.ws.WebServiceException;
348</xsl:template>
349
350<xsl:template name="endFile">
351 <xsl:param name="file" />
352 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $file, '&quot;&#10;&#10;')" />
353</xsl:template>
354
355<!-- - - - - - - - - - - - - - - - - - - - - - -
356 root match
357 - - - - - - - - - - - - - - - - - - - - - - -->
358
359<xsl:template match="/idl">
360 <xsl:if test="not($G_vboxApiSuffix)">
361 <xsl:call-template name="fatalError">
362 <xsl:with-param name="msg" select="'G_vboxApiSuffix must be given'" />
363 </xsl:call-template>
364 </xsl:if>
365 <xsl:call-template name="startFile">
366 <xsl:with-param name="file" select="'IUnknown.java'" />
367 </xsl:call-template>
368
369 <xsl:text><![CDATA[
370public class IUnknown
371{
372 protected String _this; /* almost final, could only be set in finalizer */
373 protected final VboxPortType port;
374
375 public IUnknown(String _this, VboxPortType port)
376 {
377 this._this = _this;
378 this.port = port;
379 }
380
381 public final String getRef()
382 {
383 return _this;
384 }
385
386 public final VboxPortType getRemoteWSPort()
387 {
388 return port;
389 }
390
391 public synchronized void releaseRemote() throws WebServiceException
392 {
393 if (_this == null) {
394 return;
395 }
396 try {
397 port.iManagedObjectRefRelease(_this);
398 _this = null;
399 } catch (InvalidObjectFaultMsg e) {
400 throw new WebServiceException(e);
401 } catch (RuntimeFaultMsg e) {
402 throw new WebServiceException(e);
403 }
404 }
405
406 /*
407 protected void finalize()
408 {
409 try {
410 releaseRemote();
411 } catch (WebServiceException e) {
412 }
413 } */
414
415 // may need to support some sort of QueryInterface, to make this class useable
416 // not only as common baseclass
417}
418]]></xsl:text>
419
420 <xsl:call-template name="endFile">
421 <xsl:with-param name="file" select="'IUnknown.java'" />
422 </xsl:call-template>
423
424 <xsl:call-template name="startFile">
425 <xsl:with-param name="file" select="'Helper.java'" />
426 </xsl:call-template>
427
428<xsl:text><![CDATA[
429
430import java.util.List;
431import java.util.ArrayList;
432import java.util.Collections;
433import java.util.UUID;
434import java.lang.reflect.Constructor;
435import java.lang.reflect.InvocationTargetException;
436
437class Helper {
438 public static <T> List<T> wrap(Class<T> wrapperClass, VboxPortType pt, List<String> thisPtrs) {
439 try {
440 if(thisPtrs==null) return Collections.emptyList();
441
442 Constructor<T> c = wrapperClass.getConstructor(String.class, VboxPortType.class);
443 List<T> ret = new ArrayList<T>(thisPtrs.size());
444 for (String thisPtr : thisPtrs) {
445 ret.add(c.newInstance(thisPtr,pt));
446 }
447 return ret;
448 } catch (NoSuchMethodException e) {
449 throw new AssertionError(e);
450 } catch (InstantiationException e) {
451 throw new AssertionError(e);
452 } catch (IllegalAccessException e) {
453 throw new AssertionError(e);
454 } catch (InvocationTargetException e) {
455 throw new AssertionError(e);
456 }
457 }
458
459 public static List<UUID> uuidWrap(List<String> uuidVals) {
460 List<UUID> ret = new ArrayList<UUID>(uuidVals.size());
461 for (String uuid : uuidVals) {
462 ret.add(UUID.fromString(uuid));
463 }
464 return ret;
465 }
466
467 public static <T extends IUnknown> List<String> unwrap(List<T> thisPtrs) {
468 if (thisPtrs==null) return Collections.emptyList();
469
470 List<String> ret = new ArrayList<String>();
471 for (T obj : thisPtrs) {
472 ret.add(obj.getRef());
473 }
474 return ret;
475 }
476}
477]]></xsl:text>
478
479 <xsl:call-template name="endFile">
480 <xsl:with-param name="file" select="'Helper.java'" />
481 </xsl:call-template>
482
483 <xsl:call-template name="startFile">
484 <xsl:with-param name="file" select="'IWebsessionManager.java'" />
485 </xsl:call-template>
486
487 <xsl:text><![CDATA[
488import java.net.URL;
489import java.math.BigInteger;
490import java.util.List;
491import java.util.Map;
492import java.util.HashMap;
493import java.util.UUID;
494import javax.xml.namespace.QName;
495import javax.xml.ws.BindingProvider;
496import javax.xml.ws.Holder;
497import javax.xml.ws.WebServiceException;
498
499class PortPool
500{
501 private Map<VboxPortType, Integer> known;
502 private boolean initStarted;
503 private VboxService svc;
504
505 PortPool(boolean usePreinit)
506 {
507 known = new HashMap<VboxPortType, Integer>();
508
509 if (usePreinit)
510 {
511 new Thread(new Runnable()
512 {
513 public void run()
514 {
515 // need to sync on something else but 'this'
516 synchronized (known)
517 {
518 initStarted = true;
519 known.notify();
520 }
521
522 preinit();
523 }
524 }).start();
525
526 synchronized (known)
527 {
528 while (!initStarted)
529 {
530 try {
531 known.wait();
532 } catch (InterruptedException e) {
533 break;
534 }
535 }
536 }
537 }
538 }
539
540 private synchronized void preinit()
541 {
542 VboxPortType port = getPort();
543 releasePort(port);
544 }
545
546 synchronized VboxPortType getPort()
547 {
548 VboxPortType port = null;
549 for (VboxPortType cur: known.keySet())
550 {
551 if (known.get(cur) == 0)
552 {
553 port = cur;
554 break;
555 }
556 }
557
558 if (port == null)
559 {
560 if (svc == null) {
561 URL wsdl = PortPool.class.getClassLoader().getResource("vboxwebService.wsdl");
562 if (wsdl == null)
563 throw new LinkageError("vboxwebService.wsdl not found, but it should have been in the jar");
564 svc = new VboxService(wsdl,
565 new QName("http://www.virtualbox.org/Service",
566 "vboxService"));
567 }
568 port = svc.getVboxServicePort();
569 }
570 known.put(port, new Integer(1));
571 return port;
572 }
573
574 synchronized void releasePort(VboxPortType port)
575 {
576 Integer val = known.get(port);
577 if (val == null || val == 0)
578 {
579 // know you not
580 return;
581 }
582 known.put(port, val - 1);
583 }
584}
585
586public class IWebsessionManager {
587
588 private static PortPool pool = new PortPool(true);
589 protected VboxPortType port;
590
591 public IWebsessionManager(URL url)
592 {
593 connect(url);
594 }
595
596 public IWebsessionManager(String url)
597 {
598 connect(url);
599 }
600
601 public IWebsessionManager(URL url, Map<String, Object> requestContext, Map<String, Object> responseContext)
602 {
603 connect(url.toExternalForm(), requestContext, responseContext);
604 }
605
606 public IWebsessionManager(String url, Map<String, Object> requestContext, Map<String, Object> responseContext)
607 {
608 connect(url, requestContext, responseContext);
609 }
610
611 public void connect(URL url)
612 {
613 connect(url.toExternalForm());
614 }
615
616 public void connect(String url)
617 {
618 this.port = pool.getPort();
619 ((BindingProvider)port).getRequestContext().
620 put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
621 }
622
623 public void connect(String url, Map<String, Object> requestContext, Map<String, Object> responseContext)
624 {
625 this.port = pool.getPort();
626
627 ((BindingProvider)port).getRequestContext();
628 if (requestContext != null)
629 ((BindingProvider)port).getRequestContext().putAll(requestContext);
630
631 if (responseContext != null)
632 ((BindingProvider)port).getResponseContext().putAll(responseContext);
633
634 ((BindingProvider)port).getRequestContext().
635 put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
636 }
637
638
639 public void disconnect(IVirtualBox refIVirtualBox)
640 {
641 logoff(refIVirtualBox);
642 pool.releasePort(port);
643 }
644
645 public void cleanupUnused()
646 {
647 System.gc();
648 Runtime.getRuntime().runFinalization();
649 }
650
651 /* method IWebsessionManager::logon(
652 [in] wstring username,
653 [in] wstring password,
654 [return] IVirtualBox return)
655 */
656 public IVirtualBox logon(String username, String password) {
657 try {
658 String retVal = port.iWebsessionManagerLogon(username, password);
659 return new IVirtualBox(retVal, port);
660 } catch (InvalidObjectFaultMsg e) {
661 throw new WebServiceException(e);
662 } catch (RuntimeFaultMsg e) {
663 throw new WebServiceException(e);
664 }
665 }
666
667 /* method IWebsessionManager::getSessionObject(
668 [in] IVirtualBox refIVirtualBox,
669 [return] ISession return)
670 */
671 public ISession getSessionObject(IVirtualBox refIVirtualBox) {
672 try {
673 String retVal = port.iWebsessionManagerGetSessionObject(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
674 return new ISession(retVal, port);
675 } catch (InvalidObjectFaultMsg e) {
676 throw new WebServiceException(e);
677 } catch (RuntimeFaultMsg e) {
678 throw new WebServiceException(e);
679 }
680 }
681
682 /* method IWebsessionManager::logoff(
683 [in] IVirtualBox refIVirtualBox)
684 */
685 public void logoff(IVirtualBox refIVirtualBox) {
686 try {
687 port.iWebsessionManagerLogoff(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
688 } catch (InvalidObjectFaultMsg e) {
689 throw new WebServiceException(e);
690 } catch (RuntimeFaultMsg e) {
691 throw new WebServiceException(e);
692 }
693 }
694}
695]]></xsl:text>
696 <xsl:call-template name="endFile">
697 <xsl:with-param name="file" select="'IWebsessionManager.java'" />
698 </xsl:call-template>
699
700 <xsl:text>// ######## COLLECTIONS&#10;&#10;</xsl:text>
701
702 <xsl:for-each select="//collection">
703 <xsl:variable name="type" select="@type" />
704 <xsl:variable name="arrayoftype" select="concat('ArrayOf', @type)" />
705 <xsl:variable name="filename" select="$arrayoftype" />
706
707 <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
708
709 <xsl:call-template name="startFile">
710 <xsl:with-param name="file" select="concat($filename, '.java')" />
711 </xsl:call-template>
712
713 <xsl:text>import java.util.ArrayList;&#10;</xsl:text>
714 <xsl:text>import java.util.List;&#10;</xsl:text>
715 <xsl:text>import javax.xml.bind.annotation.XmlAccessType;&#10;</xsl:text>
716 <xsl:text>import javax.xml.bind.annotation.XmlAccessorType;&#10;</xsl:text>
717 <xsl:text>import javax.xml.bind.annotation.XmlType;&#10;&#10;</xsl:text>
718
719 <xsl:text>@XmlAccessorType(XmlAccessType.FIELD)&#10;</xsl:text>
720 <xsl:value-of select="concat('@XmlType(name = &quot;', $arrayoftype, '&quot;, propOrder = {&#10;')" />
721 <xsl:text> "array"&#10;</xsl:text>
722 <xsl:text>})&#10;&#10;</xsl:text>
723 <xsl:value-of select="concat('public class ', $arrayoftype, ' {&#10;&#10;')" />
724
725 <xsl:text> protected List&lt;String&gt; array;&#10;&#10;</xsl:text>
726
727 <xsl:text> public List&lt;String&gt; getArray() {&#10;</xsl:text>
728 <xsl:text> if (array == null) {&#10;</xsl:text>
729 <xsl:text> array = new ArrayList&lt;String&gt;();&#10;</xsl:text>
730 <xsl:text> }&#10;</xsl:text>
731 <xsl:text> return this.array;&#10;</xsl:text>
732 <xsl:text> }&#10;&#10;</xsl:text>
733 <xsl:text>}&#10;</xsl:text>
734 <xsl:call-template name="endFile">
735 <xsl:with-param name="file" select="concat($filename, '.java')" />
736 </xsl:call-template>
737
738 </xsl:for-each>
739
740 <xsl:text>// ######## ENUMS&#10;&#10;</xsl:text>
741
742 <xsl:for-each select="//enum">
743 <xsl:variable name="enumname" select="@name" />
744 <xsl:variable name="filename" select="$enumname" />
745
746 <xsl:call-template name="startFile">
747 <xsl:with-param name="file" select="concat($filename, '.java')" />
748 </xsl:call-template>
749
750 <xsl:text>import javax.xml.bind.annotation.XmlEnum;&#10;</xsl:text>
751 <xsl:text>import javax.xml.bind.annotation.XmlEnumValue;&#10;</xsl:text>
752 <xsl:text>import javax.xml.bind.annotation.XmlType;&#10;&#10;</xsl:text>
753
754 <xsl:value-of select="concat('@XmlType(name = &quot;', $enumname, '&quot;)&#10;')" />
755 <xsl:text>@XmlEnum&#10;</xsl:text>
756 <xsl:value-of select="concat('public enum ', $enumname, ' {&#10;&#10;')" />
757 <xsl:for-each select="const">
758 <xsl:variable name="enumconst" select="@name" />
759 <xsl:value-of select="concat(' @XmlEnumValue(&quot;', $enumconst, '&quot;)&#10;')" />
760 <xsl:value-of select="concat(' ', $enumconst, '(&quot;', $enumconst, '&quot;)')" />
761 <xsl:choose>
762 <xsl:when test="not(position()=last())">
763 <xsl:text>,&#10;</xsl:text>
764 </xsl:when>
765 <xsl:otherwise>
766 <xsl:text>;&#10;</xsl:text>
767 </xsl:otherwise>
768 </xsl:choose>
769 </xsl:for-each>
770
771 <xsl:text>&#10;</xsl:text>
772 <xsl:text> private final String value;&#10;&#10;</xsl:text>
773
774 <xsl:value-of select="concat(' ', $enumname, '(String v) {&#10;')" />
775 <xsl:text> value = v;&#10;</xsl:text>
776 <xsl:text> }&#10;&#10;</xsl:text>
777
778 <xsl:text> public String value() {&#10;</xsl:text>
779 <xsl:text> return value;&#10;</xsl:text>
780 <xsl:text> }&#10;&#10;</xsl:text>
781
782 <xsl:value-of select="concat(' public static ', $enumname, ' fromValue(String v) {&#10;')" />
783 <xsl:value-of select="concat(' for (', $enumname, ' c: ', $enumname, '. values()) {&#10;')" />
784 <xsl:text> if (c.value.equals(v)) {&#10;</xsl:text>
785 <xsl:text> return c;&#10;</xsl:text>
786 <xsl:text> }&#10;</xsl:text>
787 <xsl:text> }&#10;</xsl:text>
788 <xsl:text> throw new IllegalArgumentException(v);&#10;</xsl:text>
789 <xsl:text> }&#10;&#10;</xsl:text>
790
791 <xsl:text>}&#10;&#10;</xsl:text>
792
793 <xsl:call-template name="endFile">
794 <xsl:with-param name="file" select="concat($filename, '.java')" />
795 </xsl:call-template>
796
797 </xsl:for-each>
798
799 <xsl:text>// ######## INTERFACES &#10;&#10;</xsl:text>
800
801 <xsl:for-each select="//interface">
802 <xsl:variable name="ifname" select="@name" />
803 <xsl:variable name="filename" select="$ifname" />
804 <xsl:variable name="wsmap" select="@wsmap" />
805 <xsl:variable name="wscpp" select="@wscpp" />
806
807 <xsl:if test="not($wsmap='suppress') and not($wsmap='struct') and not ($wsmap='global')">
808 <xsl:call-template name="startFile">
809 <xsl:with-param name="file" select="concat($filename, '.java')" />
810 </xsl:call-template>
811
812 <xsl:text>import java.math.BigInteger;&#10;</xsl:text>
813 <xsl:text>import java.util.List;&#10;</xsl:text>
814 <xsl:text>import java.util.UUID;&#10;</xsl:text>
815 <xsl:text>import javax.xml.ws.Holder;&#10;</xsl:text>
816 <xsl:text>import javax.xml.ws.WebServiceException;&#10;</xsl:text>
817
818 <xsl:choose>
819 <xsl:when test="$wsmap='struct'">
820
821 <xsl:value-of select="concat('public class ', $ifname, ' {&#10;&#10;')" />
822
823 </xsl:when>
824
825 <xsl:otherwise>
826
827 <!-- interface (class) constructor -->
828 <xsl:value-of select="concat('public class ', $ifname, ' extends IUnknown {&#10;&#10;')" />
829 <xsl:value-of select="concat(' public static ', $ifname, ' cast(IUnknown other) {&#10;')" />
830 <xsl:value-of select="concat(' return new ', $ifname,
831 '(other.getRef(), other.getRemoteWSPort());&#10; }&#10;&#10;')"/>
832 <xsl:value-of select="concat(' public ', $ifname, '(String _this, VboxPortType port) {&#10;')" />
833 <xsl:text> super(_this,port);&#10;</xsl:text>
834 <xsl:text> }&#10;</xsl:text>
835
836 <!-- attributes -->
837 <xsl:for-each select="attribute">
838 <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
839 <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
840 <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable>
841 <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
842
843 <xsl:choose>
844 <xsl:when test="( $attrtype=($G_setSuppressedInterfaces/@name) )">
845 <xsl:value-of select="concat('&#10; // Skipping attribute ', $attrtype, ' for it is of suppressed type ', $attrtype, '&#10;')" />
846 </xsl:when>
847 <xsl:otherwise>
848 <xsl:choose>
849 <xsl:when test="@readonly='yes'">
850 <xsl:value-of select="concat('&#10; // read-only attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, '&#10;')" />
851 </xsl:when>
852 <xsl:otherwise>
853 <xsl:value-of select="concat('&#10; // read/write attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, '&#10;')" />
854 </xsl:otherwise>
855 </xsl:choose>
856 <!-- emit getter method -->
857 <xsl:variable name="gettername"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
858 <xsl:variable name="jaxwsGetter"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$gettername" /></xsl:call-template></xsl:variable>
859 <xsl:variable name="gluegettertype">
860 <xsl:call-template name="typeIdl2Glue">
861 <xsl:with-param name="ifname" select="$ifname" />
862 <xsl:with-param name="method" select="$gettername" />
863 <xsl:with-param name="name" select="$attrname" />
864 <xsl:with-param name="type" select="$attrtype" />
865 <xsl:with-param name="safearray" select="@safearray" />
866 </xsl:call-template>
867 </xsl:variable>
868 <xsl:variable name="javagettertype">
869 <xsl:call-template name="typeIdl2Java">
870 <xsl:with-param name="ifname" select="$ifname" />
871 <xsl:with-param name="method" select="$gettername" />
872 <xsl:with-param name="name" select="$attrname" />
873 <xsl:with-param name="type" select="$attrtype" />
874 <xsl:with-param name="safearray" select="@safearray" />
875 </xsl:call-template>
876 </xsl:variable>
877 <xsl:value-of select="concat(' public ', $gluegettertype, ' ', $gettername, '() {&#10;')" />
878 <xsl:text> try {&#10;</xsl:text>
879 <xsl:value-of select="concat(' ', $javagettertype, ' retVal = port.', $jaxwsGetter, '(_this);&#10;')" />
880 <xsl:variable name="wrapped">
881 <xsl:call-template name="cookOutParam">
882 <xsl:with-param name="ifname" select="$ifname" />
883 <xsl:with-param name="method" select="$gettername" />
884 <xsl:with-param name="value" select="'retVal'" />
885 <xsl:with-param name="idltype" select="$attrtype" />
886 <xsl:with-param name="safearray" select="@safearray" />
887 </xsl:call-template>
888 </xsl:variable>
889 <xsl:value-of select="concat(' return ', $wrapped, ';&#10;')" />
890 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
891 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
892 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
893 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
894 <xsl:text> }&#10;</xsl:text>
895 <xsl:text> }&#10;</xsl:text>
896 <xsl:if test="not(@readonly='yes')">
897 <!-- emit setter -->
898 <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
899 <xsl:variable name="jaxwsSetter"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$settername" /></xsl:call-template></xsl:variable>
900 <xsl:variable name="javasettertype">
901 <xsl:call-template name="typeIdl2Java">
902 <xsl:with-param name="ifname" select="$ifname" />
903 <xsl:with-param name="method" select="$settername" />
904 <xsl:with-param name="name" select="$attrname" />
905 <xsl:with-param name="type" select="$attrtype" />
906 </xsl:call-template>
907 </xsl:variable>
908 <xsl:value-of select="concat(' public void ', $settername, '(', $javasettertype, ' value) {&#10;')" />
909 <xsl:text> try {&#10;</xsl:text>
910 <xsl:value-of select="concat(' port.', $jaxwsSetter, '(_this, value);&#10;')" />
911 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
912 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
913 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
914 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
915 <xsl:text> }&#10;</xsl:text>
916 <xsl:text> }&#10;</xsl:text>
917 </xsl:if>
918 </xsl:otherwise>
919 </xsl:choose>
920 </xsl:for-each> <!-- attribute -->
921
922 <!-- emit real methods -->
923 <xsl:for-each select="method">
924 <xsl:variable name="methodname"><xsl:value-of select="@name" /></xsl:variable>
925 <xsl:variable name="portArg">
926 <xsl:if test="not($wsmap='global')">
927 <xsl:value-of select="'_this'"/>
928 </xsl:if>
929 </xsl:variable>
930
931 <!-- method header: return value "int", method name, soap arguments -->
932 <!-- skip this method if it has parameters of a type that has wsmap="suppress" -->
933 <xsl:choose>
934 <xsl:when test="param[@type=($G_setSuppressedInterfaces/@name)]">
935 <xsl:comment><xsl:value-of select="concat('Skipping method ', $methodname, ' for it has parameters with suppressed types')" /></xsl:comment>
936 </xsl:when>
937 <xsl:otherwise>
938 <xsl:variable name="fHasReturnParms" select="param[@dir='return']" />
939 <xsl:variable name="fHasOutParms" select="param[@dir='out']" />
940
941 <xsl:value-of select="concat('&#10; /* method ', $ifname, '::', $methodname, '(')" />
942 <xsl:for-each select="param">
943 <xsl:value-of select="concat('&#10; [', @dir, '] ', @type, ' ', @name)" />
944 <xsl:if test="@safearray='yes'">
945 <xsl:text>[]</xsl:text>
946 </xsl:if>
947 <xsl:if test="not(position()=last())">
948 <xsl:text>,</xsl:text>
949 </xsl:if>
950 </xsl:for-each>
951 <xsl:text>)&#10; */&#10;</xsl:text>
952 <!-- method implementation -->
953 <xsl:variable name="returnidltype" select="param[@dir='return']/@type" />
954 <xsl:variable name="returnidlsafearray" select="param[@dir='return']/@safearray" />
955 <xsl:variable name="returngluetype">
956 <xsl:choose>
957 <xsl:when test="$returnidltype">
958 <xsl:call-template name="typeIdl2Glue">
959 <xsl:with-param name="ifname" select="$ifname" />
960 <xsl:with-param name="method" select="$methodname" />
961 <xsl:with-param name="name" select="@name" />
962 <xsl:with-param name="type" select="$returnidltype" />
963 <xsl:with-param name="safearray" select="param[@dir='return']/@safearray" />
964 </xsl:call-template>
965 </xsl:when>
966 <xsl:otherwise>
967 <xsl:text>void</xsl:text>
968 </xsl:otherwise>
969 </xsl:choose>
970 </xsl:variable>
971 <xsl:value-of select="concat(' public ', $returngluetype, ' ', $methodname, '(')" />
972 <!-- make a set of all parameters with in and out direction -->
973 <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
974 <xsl:for-each select="exsl:node-set($paramsinout)">
975 <xsl:variable name="paramgluetype">
976 <xsl:call-template name="typeIdl2Glue">
977 <xsl:with-param name="ifname" select="$ifname" />
978 <xsl:with-param name="method" select="$methodname" />
979 <xsl:with-param name="name" select="@name" />
980 <xsl:with-param name="type" select="@type" />
981 <xsl:with-param name="safearray" select="@safearray" />
982 </xsl:call-template>
983 </xsl:variable>
984 <xsl:choose>
985 <xsl:when test="@dir='out'">
986 <xsl:value-of select="concat('Holder&lt;', $paramgluetype, '&gt; ', @name)" />
987 </xsl:when>
988 <xsl:otherwise>
989 <xsl:value-of select="concat($paramgluetype, ' ', @name)" />
990 </xsl:otherwise>
991 </xsl:choose>
992 <xsl:if test="not(position()=last())">
993 <xsl:text>, </xsl:text>
994 </xsl:if>
995 </xsl:for-each>
996 <xsl:text>) {&#10;</xsl:text>
997 <xsl:text> try {&#10;</xsl:text>
998 <xsl:if test="param[@dir='out']">
999 <xsl:for-each select="param[@dir='out']">
1000 <xsl:variable name="paramtype" select="@type" />
1001 <xsl:if test="//interface[@name=$paramtype] or $paramtype='$unknown'">
1002 <xsl:choose>
1003 <xsl:when test="@safearray='yes'">
1004 <xsl:value-of select="concat(' Holder&lt;List&lt;String&gt;&gt; tmp', @name, ' = new Holder&lt;List&lt;String&gt;&gt;(); &#10;')" />
1005 </xsl:when>
1006 <xsl:otherwise>
1007 <xsl:value-of select="concat(' Holder&lt;String&gt; tmp', @name, ' = new Holder&lt;String&gt;(); &#10;')" />
1008 </xsl:otherwise>
1009 </xsl:choose>
1010 </xsl:if>
1011 </xsl:for-each>
1012 </xsl:if>
1013
1014 <xsl:text> </xsl:text>
1015
1016 <!-- make the function call: first have a stack variable for the return value, if any -->
1017 <!-- XSLT doesn't allow variable override in inner blocks -->
1018 <xsl:variable name="retValValue">
1019 <xsl:choose>
1020 <xsl:when test="param[@dir='out']">
1021 <xsl:value-of select="'retVal.value'"/>
1022 </xsl:when>
1023 <xsl:otherwise>
1024 <xsl:value-of select="'retVal'"/>
1025 </xsl:otherwise>
1026 </xsl:choose>
1027 </xsl:variable>
1028
1029 <xsl:if test="$returnidltype">
1030 <xsl:variable name="javarettype">
1031 <xsl:call-template name="typeIdl2Java">
1032 <xsl:with-param name="ifname" select="$ifname" />
1033 <xsl:with-param name="method" select="$methodname" />
1034 <xsl:with-param name="name" select="@name" />
1035 <xsl:with-param name="type" select="$returnidltype" />
1036 <xsl:with-param name="safearray" select="$returnidlsafearray" />
1037 </xsl:call-template>
1038 </xsl:variable>
1039 <xsl:choose>
1040 <xsl:when test="param[@dir='out']">
1041 <!-- create a new object for return value -->
1042 <xsl:value-of select="
1043 concat('Holder&lt;', $javarettype, '&gt;',
1044 ' ', 'retVal = new Holder&lt;', $javarettype,
1045 '&gt;();&#xa; ')"/>
1046 </xsl:when>
1047 <xsl:otherwise>
1048 <xsl:value-of select="$javarettype"/>
1049 <xsl:text> retVal = </xsl:text>
1050 </xsl:otherwise>
1051 </xsl:choose>
1052 </xsl:if>
1053 <!-- function name and arguments -->
1054 <xsl:variable name="jaxwsmethod"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$methodname" /></xsl:call-template></xsl:variable>
1055 <xsl:value-of select="concat('port.', $jaxwsmethod, '(', $portArg)" />
1056 <xsl:if test="$paramsinout and not($portArg='')">
1057 <xsl:text>, </xsl:text>
1058 </xsl:if>
1059 <!-- jax-ws has an oddity: if both out params and a return value exist, then the return value is moved to the function's argument list... -->
1060 <xsl:choose>
1061 <xsl:when test="param[@dir='out'] and param[@dir='return']">
1062 <xsl:for-each select="param">
1063 <xsl:choose>
1064 <xsl:when test="@dir='return'">
1065 <xsl:text>retVal</xsl:text>
1066 </xsl:when>
1067 <xsl:otherwise>
1068 <xsl:call-template name="emitArgInMethodImpl">
1069 <xsl:with-param name="paramname" select="@name" />
1070 <xsl:with-param name="paramtype" select="@type" />
1071 </xsl:call-template>
1072 </xsl:otherwise>
1073 </xsl:choose>
1074 </xsl:for-each>
1075 </xsl:when>
1076 <xsl:otherwise>
1077 <xsl:for-each select="$paramsinout">
1078 <xsl:call-template name="emitArgInMethodImpl">
1079 <xsl:with-param name="paramname" select="@name" />
1080 <xsl:with-param name="paramtype" select="@type" />
1081 </xsl:call-template>
1082 </xsl:for-each>
1083 </xsl:otherwise>
1084 </xsl:choose>
1085 <xsl:text>);&#10;</xsl:text>
1086 <!-- now copy temp out parameters to their actual destination -->
1087 <xsl:for-each select="param[@dir='out']">
1088 <xsl:variable name="paramtype" select="@type" />
1089 <xsl:if test="//interface[@name=$paramtype] or $paramtype='$unknown'">
1090 <xsl:variable name="paramname" select="@name" />
1091 <xsl:variable name="wrapped">
1092 <xsl:call-template name="cookOutParam">
1093 <xsl:with-param name="ifname" select="$ifname" />
1094 <xsl:with-param name="method" select="$methodname" />
1095 <xsl:with-param name="value" select="concat('tmp',@name,'.value')" />
1096 <xsl:with-param name="idltype" select="@type" />
1097 <xsl:with-param name="safearray" select="@safearray" />
1098 </xsl:call-template>
1099 </xsl:variable>
1100 <xsl:value-of select="concat(' ',$paramname,'.value = ',
1101 $wrapped,';&#10;')"/>
1102 </xsl:if>
1103 </xsl:for-each>
1104 <!-- next line with return + glue type -->
1105 <xsl:if test="$returnidltype">
1106 <xsl:variable name="retval">
1107 <xsl:call-template name="cookOutParam">
1108 <xsl:with-param name="ifname" select="$ifname" />
1109 <xsl:with-param name="method" select="$methodname" />
1110 <xsl:with-param name="value" select="$retValValue" />
1111 <xsl:with-param name="idltype" select="$returnidltype" />
1112 <xsl:with-param name="safearray" select="$returnidlsafearray" />
1113 </xsl:call-template>
1114 </xsl:variable>
1115 <xsl:value-of select="concat(' return ', $retval, ';&#10;')"/>
1116 </xsl:if>
1117 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
1118 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
1119 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
1120 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
1121 <xsl:text> }&#10;</xsl:text>
1122 <xsl:text> }&#10;</xsl:text>
1123 </xsl:otherwise>
1124 </xsl:choose>
1125 </xsl:for-each>
1126
1127 </xsl:otherwise>
1128 </xsl:choose>
1129 <!-- end of class -->
1130 <xsl:text>}&#10;</xsl:text>
1131 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
1132 <xsl:call-template name="endFile">
1133 <xsl:with-param name="file" select="concat($filename, '.java')" />
1134 </xsl:call-template>
1135 </xsl:if>
1136 </xsl:for-each>
1137
1138<!-- <xsl:apply-templates /> -->
1139</xsl:template>
1140
1141<!-- - - - - - - - - - - - - - - - - - - - - - -
1142 if
1143 - - - - - - - - - - - - - - - - - - - - - - -->
1144
1145<!--
1146 * ignore all |if|s except those for WSDL target
1147-->
1148<xsl:template match="if">
1149 <xsl:if test="@target='wsdl'">
1150 <xsl:apply-templates/>
1151 </xsl:if>
1152</xsl:template>
1153
1154<!-- - - - - - - - - - - - - - - - - - - - - - -
1155 cpp
1156 - - - - - - - - - - - - - - - - - - - - - - -->
1157
1158<xsl:template match="cpp">
1159<!-- ignore this -->
1160</xsl:template>
1161
1162<!-- - - - - - - - - - - - - - - - - - - - - - -
1163 library
1164 - - - - - - - - - - - - - - - - - - - - - - -->
1165
1166<xsl:template match="library">
1167 <xsl:apply-templates />
1168</xsl:template>
1169
1170<!-- - - - - - - - - - - - - - - - - - - - - - -
1171 class
1172 - - - - - - - - - - - - - - - - - - - - - - -->
1173
1174<xsl:template match="module/class">
1175<!-- TODO swallow for now -->
1176</xsl:template>
1177
1178<!-- - - - - - - - - - - - - - - - - - - - - - -
1179 enum
1180 - - - - - - - - - - - - - - - - - - - - - - -->
1181
1182<xsl:template match="enum">
1183</xsl:template>
1184
1185<!-- - - - - - - - - - - - - - - - - - - - - - -
1186 const
1187 - - - - - - - - - - - - - - - - - - - - - - -->
1188
1189<!--
1190<xsl:template match="const">
1191 <xsl:apply-templates />
1192</xsl:template>
1193-->
1194
1195<!-- - - - - - - - - - - - - - - - - - - - - - -
1196 desc
1197 - - - - - - - - - - - - - - - - - - - - - - -->
1198
1199<xsl:template match="desc">
1200<!-- TODO swallow for now -->
1201</xsl:template>
1202
1203<!-- - - - - - - - - - - - - - - - - - - - - - -
1204 note
1205 - - - - - - - - - - - - - - - - - - - - - - -->
1206
1207<xsl:template match="note">
1208<!-- TODO -->
1209 <xsl:apply-templates />
1210</xsl:template>
1211
1212<!-- - - - - - - - - - - - - - - - - - - - - - -
1213 interface
1214 - - - - - - - - - - - - - - - - - - - - - - -->
1215
1216<xsl:template match="interface">
1217
1218</xsl:template>
1219
1220
1221</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette