VirtualBox

Changeset 29757 in vbox for trunk/src/libs


Ignore:
Timestamp:
May 24, 2010 7:24:16 AM (15 years ago)
Author:
vboxsync
Message:

Java glue: XPCOM done

Location:
trunk/src/libs/xpcom18a4/java
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/java/Makefile.kmk

    r29724 r29757  
    270270        $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxyBase.java \
    271271        $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxy.java
    272 VBOX_JXPCOM_MGR = \
    273      $(VBOX_JXPCOM_SRC)/src/org/virtualbox/VirtualBoxManager.java \
    274      $(VBOX_JXPCOM_SRC)/src/org/virtualbox/VBoxObjectBase.java
    275272
    276273$$(VBOX_JXPCOM_JAR): $(VBOX_JXPCOM_JAR_SRC) $(VBOX_JXPCOM_GEN)/jxpcomgen.list $(VBOX_JXPCOM_GEN)/jxpcomglue.list $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR) | $$(dir $$@)
     
    284281                $(VBOX_JXPCOM_JAR_SRC) \
    285282                $(VBOX_JXPCOM_NSERROR) \
    286                 $(VBOX_JXPCOM_MGR) \
    287283                @$(VBOX_JXPCOM_GEN)/jxpcomglue.list \
    288284                -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
  • trunk/src/libs/xpcom18a4/java/tests/TestVBox.java

    r29231 r29757  
    1111 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1212 */
    13 
    14 import org.mozilla.interfaces.*;
    15 import org.virtualbox.*;
     13import org.virtualbox_3_2.*;
     14import java.util.List;
    1615
    1716class VBoxCallbacks extends VBoxObjectBase implements IVirtualBoxCallback
     
    2827    }
    2928    public void onSnapshotTaken(String machineId, String snapshotId) {}
    30     public void onSessionStateChange(String machineId, long state)
     29    public void onSessionStateChange(String machineId, SessionState state)
    3130    {
    3231        System.out.println("onSessionStateChange -- VM: " + machineId + ", state: " + state);
    3332    }
    34     public void onMachineRegistered(String machineId, boolean registered) {}
    35     public void onMediumRegistered(String mediumId, long mediumType, boolean registered) {}
     33    public void onMachineRegistered(String machineId, Boolean registered) {}
     34    public void onMediumRegistered(String mediumId, DeviceType mediumType, Boolean registered) {}
    3635    public void onExtraDataChange(String machineId, String key, String value)
    3736    {
    3837        System.out.println("onExtraDataChange -- VM: " + machineId + ": " + key+"->"+value);
    3938    }
    40     public boolean onExtraDataCanChange(String machineId, String key, String value, String[] error) { return true; }
     39    public Boolean onExtraDataCanChange(String machineId, String key, String value, Holder<String> error) { return true; }
    4140    public void onMachineDataChange(String machineId)
    4241    {}
    43     public void onMachineStateChange(String machineId, long state)
     42    public void onMachineStateChange(String machineId, MachineState state)
    4443    {
    4544        System.out.println("onMachineStateChange -- VM: " + machineId + ", state: " + state);
     
    5150    static void testCallbacks(VirtualBoxManager mgr, IVirtualBox vbox)
    5251    {
    53         IVirtualBoxCallback cbs = new VBoxCallbacks();
     52        IVirtualBoxCallback cbs = mgr.createIVirtualBoxCallback(new VBoxCallbacks());
    5453        vbox.registerCallback(cbs);
    5554        for (int i=0; i<100; i++)
     
    6261    static void testEnumeration(VirtualBoxManager mgr, IVirtualBox vbox)
    6362    {
    64         IMachine[] machs = vbox.getMachines(null);
     63        List<IMachine> machs = vbox.getMachines();
    6564        for (IMachine m : machs)
    6665        {
     
    7473    static void testStart(VirtualBoxManager mgr, IVirtualBox vbox)
    7574    {
    76         String m =  vbox.getMachines(null)[0].getName();
     75        String m =  vbox.getMachines().get(0).getName();
    7776        System.out.println("\nAttempting to start VM '" + m + "'");
    7877        mgr.startVm(m, null, 7000);
     
    9089            System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
    9190            testEnumeration(mgr, vbox);
     91            //testStart(mgr, vbox);
    9292            testCallbacks(mgr, vbox);
    9393
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