VirtualBox

Changeset 18605 in vbox for trunk/src/VBox/Main/webservice


Ignore:
Timestamp:
Apr 1, 2009 4:11:51 PM (16 years ago)
Author:
vboxsync
Message:

SDK: better JAX-WS versioning

Location:
trunk/src/VBox/Main/webservice
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/Makefile.kmk

    r18422 r18605  
    366366 endif
    367367 VBOX_JAR                      = jar
     368 # Keep in sync with G_virtualBoxPackage and G_virtualBoxPackage2 in glue-jaxws.xsl
     369 # Bump up once incompatible API version takes place
     370 VBOX_JAVA_PACKAGE             = org.virtualbox22
    368371
    369372 VBOXWEB_OTHERS               += \
     
    622625        $(QUIET)$(MKDIR) -p $(VBOXWEB_JAVALIB)/gen15
    623626        $(call MSG_GENERATE,,$@,JAX-WS for Java 1.5 bindings using $(VBOXWEBSERVICE_WSDL))
    624         $(QUIET)$(VBOX_WSIMPORT15) -d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL)
     627        $(QUIET)$(VBOX_WSIMPORT15) -p $(VBOX_JAVA_PACKAGE) -d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL)
    625628        $(call MSG_L1,Compiling bridge code)
    626629        $(QUIET)$(VBOX_JAVAC15) -cp \
     
    637640        $(MKDIR) -p $(VBOXWEB_JAVALIB)/gen16
    638641        $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
    639         $(QUIET)$(VBOX_WSIMPORT16) -d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL)
     642        $(QUIET)$(VBOX_WSIMPORT16) -p $(VBOX_JAVA_PACKAGE)  -d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL)
    640643        $(call MSG_L1,Compiling bridge code)
    641644        $(QUIET)$(VBOX_JAVAC16) -cp $(VBOXWEB_JAVALIB)/gen16 \
  • trunk/src/VBox/Main/webservice/glue-jaxws.xsl

    r16951 r18605  
    4040<xsl:variable name="G_xsltFilename" select="'glue-jaxws.xsl'" />
    4141
     42<!-- Keep in sync with VBOX_JAVA_PACKAGE in webservices/Makefile.kmk -->
     43<xsl:variable name="G_virtualBoxPackage" select="'org.virtualbox22'" />
     44<xsl:variable name="G_virtualBoxPackage2" select="'com.sun.xml.ws.commons.virtualbox22'" />
     45
    4246<xsl:include href="websrv-shared.inc.xsl" />
    4347
     
    4751              select="//interface[@wsmap='suppress']" />
    4852
     53
    4954<xsl:template name="fileheader">
    5055  <xsl:param name="name" />
    51   <xsl:text>
    52 /**
    53  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     56  <xsl:text>/**
     57 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    5458 *
    5559 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6569 * additional information or have any questions.
    6670 *
    67  * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT!
     71</xsl:text>
     72  <xsl:value-of select="concat(' * ',$name)"/>
     73<xsl:text>
     74 *
     75 * DO NOT EDIT! This is a generated file.
     76 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
     77 * Generator: src/VBox/Main/webservice/glue-jaxws.xsl
    6878 */
    6979
     
    8797     </xsl:when>
    8898     <xsl:when test="//enum[@name=$name] or //enum[@name=$origname]">
    89        <xsl:value-of select="concat('org.virtualbox.', $name)" />
     99       <xsl:value-of select="concat($G_virtualBoxPackage,  concat('.', $name))" />
    90100     </xsl:when>
    91101      <xsl:when test="$collPrefix and //interface[@name=$origname]/@wsmap='managed'">
    92          <xsl:value-of select="concat('org.virtualbox.', $name)" />
     102         <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
    93103      </xsl:when>
    94104     <xsl:when test="//interface[@name=$name]/@wsmap='struct' or //interface[@name=$origname]/@wsmap='struct'">
    95        <xsl:value-of select="concat('org.virtualbox.', $name)" />
     105       <xsl:value-of select="concat($G_virtualBoxPackage,  concat('.', $name))" />
    96106     </xsl:when>
    97107     <xsl:otherwise>
    98        <xsl:value-of select="concat('com.sun.xml.ws.commons.virtualbox.', $name)" />
     108       <xsl:value-of select="concat($G_virtualBoxPackage2,  concat('.', $name))" />
    99109     </xsl:otherwise>
    100110   </xsl:choose>
     
    231241      </xsl:variable>
    232242      <xsl:choose>
    233         <xsl:when test="contains($elemtype, 'org.virtualbox')">
     243        <xsl:when test="contains($elemtype,  $G_virtualBoxPackage)">
    234244          <xsl:value-of select="concat($value,'.getArray()')" />
    235245        </xsl:when>
     
    315325</xsl:template>
    316326
     327<xsl:template name="startFile">
     328  <xsl:param name="file" />
     329 
     330  <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $file, '&quot;&#10;&#10;')" />
     331  <xsl:call-template name="fileheader">
     332    <xsl:with-param name="name" select="$file" />
     333  </xsl:call-template>
     334package <xsl:value-of select="$G_virtualBoxPackage2" />;
     335
     336import <xsl:value-of select="$G_virtualBoxPackage" />.VboxPortType;
     337import <xsl:value-of select="$G_virtualBoxPackage" />.VboxService;
     338import <xsl:value-of select="$G_virtualBoxPackage" />.InvalidObjectFaultMsg;
     339import <xsl:value-of select="$G_virtualBoxPackage" />.RuntimeFaultMsg;
     340import javax.xml.ws.WebServiceException;
     341</xsl:template>
     342
     343<xsl:template name="endFile">
     344 <xsl:param name="file" />
     345 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $file, '&quot;&#10;&#10;')" />
     346</xsl:template>
    317347
    318348<!-- - - - - - - - - - - - - - - - - - - - - - -
     
    321351
    322352<xsl:template match="/idl">
    323   <xsl:text><![CDATA[
    324 /* DO NOT EDIT! This is a generated file.
    325  * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
    326  * Generator: src/VBox/Main/webservice/glue-jaxws.xsl
    327  */
    328 
    329 // ##### BEGINFILE "IUnknown.java"
    330 package com.sun.xml.ws.commons.virtualbox;
    331 
    332 import org.virtualbox.service.VboxPortType;
    333 import org.virtualbox.service.InvalidObjectFaultMsg;
    334 import org.virtualbox.service.RuntimeFaultMsg;
    335 import javax.xml.ws.WebServiceException;
    336 
     353 <xsl:call-template name="startFile">
     354  <xsl:with-param name="file" select="'IUnknown.java'" />
     355 </xsl:call-template>
     356
     357 <xsl:text><![CDATA[
    337358public class IUnknown
    338359{
     
    383404   // not only as common baseclass
    384405}
    385 
    386 // ##### ENDFILE "IUnknown.java"
    387 
    388 // ##### BEGINFILE "Helper.java"
    389 
    390 package com.sun.xml.ws.commons.virtualbox;
     406]]></xsl:text>
     407
     408 <xsl:call-template name="endFile">
     409   <xsl:with-param name="file" select="'IUnknown.java'" />
     410 </xsl:call-template>
     411
     412 <xsl:call-template name="startFile">
     413   <xsl:with-param name="file" select="'Helper.java'" />
     414 </xsl:call-template>
     415
     416<xsl:text><![CDATA[
    391417
    392418import java.util.List;
     
    396422import java.lang.reflect.Constructor;
    397423import java.lang.reflect.InvocationTargetException;
    398 import org.virtualbox.service.InvalidObjectFaultMsg;
    399 import org.virtualbox.service.RuntimeFaultMsg;
    400 import org.virtualbox.service.VboxService;
    401 import org.virtualbox.service.VboxPortType;
    402424
    403425class Helper {
     
    441463    }
    442464}
    443 
    444 // ##### ENDFILE "Helper.java"
    445 
    446 // ##### BEGINFILE "IWebsessionManager.java"
    447 
    448 
    449 /**
    450  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    451  *
    452  * This file is part of VirtualBox Open Source Edition (OSE), as
    453  * available from http://www.virtualbox.org. This file is free software;
    454  * you can redistribute it and/or modify it under the terms of the GNU
    455  * General Public License (GPL) as published by the Free Software
    456  * Foundation, in version 2 as it comes in the "COPYING" file of the
    457  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    458  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    459  *
    460  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
    461  * Clara, CA 95054 USA or visit http://www.sun.com if you need
    462  * additional information or have any questions.
    463  *
    464  * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT!
    465  */
    466 
    467 package com.sun.xml.ws.commons.virtualbox;
    468 
     465]]></xsl:text>
     466
     467 <xsl:call-template name="endFile">
     468  <xsl:with-param name="file" select="'Helper.java'" />
     469 </xsl:call-template>
     470
     471 <xsl:call-template name="startFile">
     472  <xsl:with-param name="file" select="'IWebsessionManager.java'" />
     473 </xsl:call-template>
     474
     475 <xsl:text><![CDATA[
    469476import java.net.URL;
    470477import java.math.BigInteger;
     
    477484import javax.xml.ws.Holder;
    478485import javax.xml.ws.WebServiceException;
    479 import com.sun.xml.ws.commons.virtualbox.IUnknown;
    480 
    481 import org.virtualbox.service.InvalidObjectFaultMsg;
    482 import org.virtualbox.service.RuntimeFaultMsg;
    483 import org.virtualbox.service.VboxService;
    484 import org.virtualbox.service.VboxPortType;
    485486
    486487class PortPool
     
    624625
    625626
    626     public void disconnect(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox)
     627    public void disconnect(IVirtualBox refIVirtualBox)
    627628    {
    628629        logoff(refIVirtualBox);
     
    641642            [return] IVirtualBox return)
    642643     */
    643     public com.sun.xml.ws.commons.virtualbox.IVirtualBox logon(String username, String password) {
     644    public IVirtualBox logon(String username, String password) {
    644645        try {
    645646            String retVal = port.iWebsessionManagerLogon(username, password);
    646             return new com.sun.xml.ws.commons.virtualbox.IVirtualBox(retVal, port);
     647            return new IVirtualBox(retVal, port);
    647648        } catch (InvalidObjectFaultMsg e) {
    648649            throw new WebServiceException(e);
     
    656657            [return] ISession return)
    657658     */
    658     public com.sun.xml.ws.commons.virtualbox.ISession getSessionObject(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {
     659    public ISession getSessionObject(IVirtualBox refIVirtualBox) {
    659660        try {
    660661            String retVal = port.iWebsessionManagerGetSessionObject(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
    661             return new com.sun.xml.ws.commons.virtualbox.ISession(retVal, port);
     662            return new ISession(retVal, port);
    662663        } catch (InvalidObjectFaultMsg e) {
    663664            throw new WebServiceException(e);
     
    670671            [in] IVirtualBox refIVirtualBox)
    671672     */
    672     public void logoff(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {
     673    public void logoff(IVirtualBox refIVirtualBox) {
    673674        try {
    674675            port.iWebsessionManagerLogoff(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
     
    680681    }
    681682}
    682 
    683 // ##### ENDFILE "IWebsessionManager.java"
    684 
    685683]]></xsl:text>
     684 <xsl:call-template name="endFile">
     685  <xsl:with-param name="file" select="'IWebsessionManager.java'" />
     686 </xsl:call-template>
    686687
    687688  <xsl:text>// ######## COLLECTIONS&#10;&#10;</xsl:text>
     
    694695    <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
    695696
    696     <xsl:call-template name="fileheader">
    697       <xsl:with-param name="name" select="$filename" />
     697    <xsl:call-template name="startFile">
     698      <xsl:with-param name="file" select="concat($filename, '.java')" />
    698699    </xsl:call-template>
    699 
    700     <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
    701700
    702701    <xsl:text>import java.util.ArrayList;&#10;</xsl:text>
     
    721720    <xsl:text>    }&#10;&#10;</xsl:text>
    722721    <xsl:text>}&#10;</xsl:text>
    723 
    724     <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
     722    <xsl:call-template name="endFile">
     723      <xsl:with-param name="file" select="concat($filename, '.java')" />
     724    </xsl:call-template>
     725   
    725726  </xsl:for-each>
    726727
     
    731732    <xsl:variable name="filename" select="$enumname" />
    732733
    733     <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
    734 
    735     <xsl:call-template name="fileheader">
    736       <xsl:with-param name="name" select="$filename" />
     734    <xsl:call-template name="startFile">
     735      <xsl:with-param name="file" select="concat($filename, '.java')" />
    737736    </xsl:call-template>
    738737
    739     <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
    740738    <xsl:text>import javax.xml.bind.annotation.XmlEnum;&#10;</xsl:text>
    741739    <xsl:text>import javax.xml.bind.annotation.XmlEnumValue;&#10;</xsl:text>
     
    781779    <xsl:text>}&#10;&#10;</xsl:text>
    782780
    783     <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
     781    <xsl:call-template name="endFile">
     782      <xsl:with-param name="file" select="concat($filename, '.java')" />
     783    </xsl:call-template>
    784784
    785785  </xsl:for-each>
     
    794794
    795795    <xsl:if test="not($wsmap='suppress') and not($wsmap='struct') and not ($wsmap='global')">
    796       <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
    797 
    798       <xsl:call-template name="fileheader">
    799         <xsl:with-param name="name" select="$filename" />
     796      <xsl:call-template name="startFile">
     797        <xsl:with-param name="file" select="concat($filename, '.java')" />
    800798      </xsl:call-template>
    801 
    802       <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
    803799
    804800      <xsl:text>import java.math.BigInteger;&#10;</xsl:text>
     
    806802      <xsl:text>import java.util.UUID;&#10;</xsl:text>
    807803      <xsl:text>import javax.xml.ws.Holder;&#10;</xsl:text>
    808       <xsl:text>import javax.xml.ws.WebServiceException;&#10;</xsl:text>
    809       <xsl:text>import com.sun.xml.ws.commons.virtualbox.IUnknown;&#10;&#10;</xsl:text>
    810       <xsl:text>import org.virtualbox.service.InvalidObjectFaultMsg;&#10;</xsl:text>
    811       <xsl:text>import org.virtualbox.service.RuntimeFaultMsg;&#10;</xsl:text>
    812       <xsl:text>import org.virtualbox.service.VboxService;&#10;</xsl:text>
    813       <xsl:text>import org.virtualbox.service.VboxPortType;&#10;&#10;</xsl:text>
     804      <xsl:text>import javax.xml.ws.WebServiceException;&#10;</xsl:text>     
    814805
    815806      <xsl:choose>
     
    11271118      <xsl:text>}&#10;</xsl:text>
    11281119      <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
     1120      <xsl:call-template name="endFile">
     1121        <xsl:with-param name="file" select="concat($filename, '.java')" />
     1122      </xsl:call-template>
    11291123    </xsl:if>
    11301124  </xsl:for-each>
  • trunk/src/VBox/Main/webservice/samples/java/jax-ws/clienttest.java

    r16124 r18605  
    1919 * additional information or have any questions.
    2020 */
    21 import com.sun.xml.ws.commons.virtualbox.*;
     21import com.sun.xml.ws.commons.virtualbox22.*;
    2222import java.util.*;
    2323import javax.xml.ws.Holder;
    24 import org.virtualbox.*;
     24import org.virtualbox22.*;
    2525
    2626public class clienttest
     
    121121        {
    122122            int i = 0;
    123             for (IMachine m : vbox.getMachines2())
     123            for (IMachine m : vbox.getMachines())
    124124            {
    125125                System.out.println("Machine " + (i++) + ": " + " [" + m.getId() + "]" + " - " + m.getName());
Note: See TracChangeset for help on using the changeset viewer.

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