Registering a callback in Java

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm able to edit org.libvirt.Domain.java and print a message when, for example suspend() is called. However I want to use eventCallback API of libvirt.
Isn't this the proper piece of code to register a callback to any domain(domain parameter is null), for a lifecycle event(event id 0).
conn.domainEventRegisterAny(null,
                        0,
                        new VirConnectDomainEventGenericCallback() {

                    public void eventCallback(ConnectionPointer cp, DomainPointer dp, Pointer pntr) {
                        System.out.println("event!");
                    }
});
 I can't get the println when I suspend or resume the domains. And the reason I wrote "0" is that I could not find VIR_DOMAIN_EVENT_ID_LIFECYCLE constant in java API. Any help about where to find macros,types and enumerations in java API is appreciated. Unfortunately I can not find anything about events in javadoc neither. Any comments?

Kind regards
Kadir


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux