[libvirt-users] Registering a callback in Java

kadir yüceer kadiryuceer at gmail.com
Wed Apr 6 07:46:51 UTC 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20110406/0999bb92/attachment.htm>


More information about the libvirt-users mailing list