Changeset 29757 in vbox for trunk/src/libs
- Timestamp:
- May 24, 2010 7:24:16 AM (15 years ago)
- Location:
- trunk/src/libs/xpcom18a4/java
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/java/Makefile.kmk
r29724 r29757 270 270 $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxyBase.java \ 271 271 $(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.java275 272 276 273 $$(VBOX_JXPCOM_JAR): $(VBOX_JXPCOM_JAR_SRC) $(VBOX_JXPCOM_GEN)/jxpcomgen.list $(VBOX_JXPCOM_GEN)/jxpcomglue.list $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR) | $$(dir $$@) … … 284 281 $(VBOX_JXPCOM_JAR_SRC) \ 285 282 $(VBOX_JXPCOM_NSERROR) \ 286 $(VBOX_JXPCOM_MGR) \287 283 @$(VBOX_JXPCOM_GEN)/jxpcomglue.list \ 288 284 -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST) -
trunk/src/libs/xpcom18a4/java/tests/TestVBox.java
r29231 r29757 11 11 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 12 12 */ 13 14 import org.mozilla.interfaces.*; 15 import org.virtualbox.*; 13 import org.virtualbox_3_2.*; 14 import java.util.List; 16 15 17 16 class VBoxCallbacks extends VBoxObjectBase implements IVirtualBoxCallback … … 28 27 } 29 28 public void onSnapshotTaken(String machineId, String snapshotId) {} 30 public void onSessionStateChange(String machineId, longstate)29 public void onSessionStateChange(String machineId, SessionState state) 31 30 { 32 31 System.out.println("onSessionStateChange -- VM: " + machineId + ", state: " + state); 33 32 } 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) {} 36 35 public void onExtraDataChange(String machineId, String key, String value) 37 36 { 38 37 System.out.println("onExtraDataChange -- VM: " + machineId + ": " + key+"->"+value); 39 38 } 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; } 41 40 public void onMachineDataChange(String machineId) 42 41 {} 43 public void onMachineStateChange(String machineId, longstate)42 public void onMachineStateChange(String machineId, MachineState state) 44 43 { 45 44 System.out.println("onMachineStateChange -- VM: " + machineId + ", state: " + state); … … 51 50 static void testCallbacks(VirtualBoxManager mgr, IVirtualBox vbox) 52 51 { 53 IVirtualBoxCallback cbs = new VBoxCallbacks();52 IVirtualBoxCallback cbs = mgr.createIVirtualBoxCallback(new VBoxCallbacks()); 54 53 vbox.registerCallback(cbs); 55 54 for (int i=0; i<100; i++) … … 62 61 static void testEnumeration(VirtualBoxManager mgr, IVirtualBox vbox) 63 62 { 64 IMachine[] machs = vbox.getMachines(null);63 List<IMachine> machs = vbox.getMachines(); 65 64 for (IMachine m : machs) 66 65 { … … 74 73 static void testStart(VirtualBoxManager mgr, IVirtualBox vbox) 75 74 { 76 String m = vbox.getMachines( null)[0].getName();75 String m = vbox.getMachines().get(0).getName(); 77 76 System.out.println("\nAttempting to start VM '" + m + "'"); 78 77 mgr.startVm(m, null, 7000); … … 90 89 System.out.println("VirtualBox version: " + vbox.getVersion() + "\n"); 91 90 testEnumeration(mgr, vbox); 91 //testStart(mgr, vbox); 92 92 testCallbacks(mgr, vbox); 93 93
Note:
See TracChangeset
for help on using the changeset viewer.