VirtualBox

source: vbox/trunk/src/VBox/Main/win/samples/VBoxCallbacks.java@ 33517

Last change on this file since 33517 was 31883, checked in by vboxsync, 14 years ago

Main: export some examples to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: VBoxCallbacks.java 31883 2010-08-24 07:17:28Z vboxsync $ */
2/*
3 * Copyright (C) 2010 Oracle Corporation
4 *
5 * This file is part of VirtualBox Open Source Edition (OSE), as
6 * available from http://www.virtualbox.org. This file is free software;
7 * you can redistribute it and/or modify it under the terms of the GNU
8 * General Public License (GPL) as published by the Free Software
9 * Foundation, in version 2 as it comes in the "COPYING" file of the
10 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
11 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
12 */
13
14import com.jacob.com.*;
15
16public class VBoxCallbacks
17{
18 public void OnGuestPropertyChange(Variant[] args)
19 {
20 String machineId = args[0].getString();
21 String name = args[1].getString();
22 String value = args[2].getString();
23 String flags = args[3].getString();;
24 System.out.println("onGuestPropertyChange -- VM: " + machineId + ", " + name + "->" + value);
25 }
26 public void OnSnapshotChange(String machineId, String snapshotId)
27 {
28 System.out.println("onGuestSnapshotChange -- VM: " + machineId + ", " + snapshotId);
29 }
30 public void onSnapshotDeleted(String machineId, String snapshotId)
31 {
32 System.out.println("onSnapshotDeleted -- VM: " + machineId + ", " + snapshotId);
33 }
34 public void onSnapshotTaken(String machineId, String snapshotId)
35 {
36 }
37 public void OnSessionStateChange(Variant[] args)
38 {
39 String machineId = args[0].getString();
40 int state = args[1].getInt();
41 System.out.println("onSessionStateChange -- VM: " + machineId + ", state: " + state);
42 }
43 public void onMachineRegistered(String machineId, boolean registered) {}
44 public void onMediumRegistered(String mediumId, long mediumType, boolean registered) {}
45 public void onExtraDataChange(String machineId, String key, String value)
46 {
47 System.out.println("onExtraDataChange -- VM: " + machineId + ": " + key+"->"+value);
48 }
49 public Variant OnExtraDataCanChange(String machineId, String key, String value, String[] error)
50 {
51 return new Variant(true);
52 }
53 public void onMachineDataChange(String machineId)
54 {}
55 public void OnMachineStateChange(Variant[] args)
56 {
57 String machineId = args[0].getString();
58 int state = args[1].getInt();
59 System.out.println("onMachineStateChange -- VM: " + machineId + ", state: " + state);
60 }
61}
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