VirtualBox

Changeset 29183 in vbox for trunk/src/libs/xpcom18a4/java


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

non working callback sample

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/java/tests/TestVBox.java

    r29180 r29183  
    1717public class TestVBox
    1818{
     19
     20    public static class VBoxCallbacks implements IVirtualBoxCallback
     21    {
     22        public void onGuestPropertyChange(String machineId, String name, String value, String flags) {}
     23        public void onSnapshotChange(String machineId, String snapshotId) {}
     24        public void onSnapshotDeleted(String machineId, String snapshotId) {}
     25        public void onSnapshotTaken(String machineId, String snapshotId) {}
     26        /** @todo is there a type SessionState instead of long? */
     27        public void onSessionStateChange(String machineId, long state) {}
     28        public void onMachineRegistered(String machineId, boolean registered) {}
     29        /** @todo long -> MediumType */
     30        public void onMediumRegistered(String mediumId, long mediumType, boolean registered) {}
     31        public void onExtraDataChange(String machineId, String key, String value) {}
     32        public boolean onExtraDataCanChange(String machineId, String key, String value, String[] error) { return true; }
     33        public void onMachineDataChange(String machineId) {}
     34        /** @todo long -> MachineState */
     35        public void onMachineStateChange(String machineId, long state) { System.out.println("onMachineStateChange -- VM: " + machineId + ", state: " + state); };
     36       
     37        /** @todo ugly reimplementation of queryInterface, should have base class to derive from */
     38        public nsISupports queryInterface(String iid) { return org.mozilla.xpcom.Mozilla.queryInterface(this, iid); }
     39    };
     40       
     41       
    1942    public static void main(String[] args)
    2043    {
     
    4568            }
    4669
     70//            VBoxCallbacks vboxCallbacks = new VBoxCallbacks();
     71//            vbox.registerCallback(vboxCallbacks);
     72
    4773            /* do something silly, start the first VM in the list */
    4874            String m = machs[0].getName();
     
    5783                System.out.println("cannot start machine "+m);
    5884            }
     85           
     86//            vbox.unregisterCallback(vboxCallbacks);
    5987        }
    6088        catch (Throwable e)
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