Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-26 Thread Tóth István
I do not yet understand the events system, but one thing struck me: public void handle(Domain dom, int event) { I think that the virDomainEventType C enum shuld be represented as a Java Enum, just as all other ENUMS are. It does require some trickery, but makes for cleaner code (not in the bi

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-19 Thread Daniel P. Berrange
On Tue, Nov 18, 2008 at 01:16:46PM -0500, David Lively wrote: > On Mon, 2008-11-17 at 22:22 +, Daniel P. Berrange wrote: > > On Mon, Nov 17, 2008 at 03:55:13PM -0500, David Lively wrote: > > > Functionally this all looks fine. > > > > From a style point of view, we should keep consistency wit

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-18 Thread David Lively
On Mon, 2008-11-17 at 22:22 +, Daniel P. Berrange wrote: > On Mon, Nov 17, 2008 at 03:55:13PM -0500, David Lively wrote: > Functionally this all looks fine. > > From a style point of view, we should keep consistency with the other > virEventAddHandle func in terms of typing / param ordering.

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-17 Thread Daniel P. Berrange
On Mon, Nov 17, 2008 at 03:55:13PM -0500, David Lively wrote: > On Fri, 2008-11-14 at 12:59 -0500, David Lively wrote: > > On Fri, 2008-11-14 at 17:09 +, Daniel P. Berrange wrote: > > > Or have the virConnectDomainEventRegister method take an extra parameter > > > which is a callbackvoid (*

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-17 Thread David Lively
On Fri, 2008-11-14 at 12:59 -0500, David Lively wrote: > On Fri, 2008-11-14 at 17:09 +, Daniel P. Berrange wrote: > > Or have the virConnectDomainEventRegister method take an extra parameter > > which is a callbackvoid (*freefunc)(void*). libvirt would just invoke > > that to free the opaqu

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-14 Thread David Lively
On Fri, 2008-11-14 at 17:09 +, Daniel P. Berrange wrote: > On Fri, Nov 14, 2008 at 12:00:10PM -0500, David Lively wrote: > > > > > > +JNIEXPORT void JNICALL Java_org_libvirt_Connect_registerForDomainEvents > > > > +(JNIEnv *env, jobject obj, jlong VCP){ > > > > +// TODO: Need to Delete

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-14 Thread Daniel P. Berrange
On Fri, Nov 14, 2008 at 12:00:10PM -0500, David Lively wrote: > > > > +JNIEXPORT void JNICALL Java_org_libvirt_Connect_registerForDomainEvents > > > +(JNIEnv *env, jobject obj, jlong VCP){ > > > +// TODO: Need to DeleteGlobalRef(obj) when deregistering for > > > callbacks. > > > +

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-14 Thread David Lively
On Wed, 2008-11-12 at 10:22 +0100, Daniel Veillard wrote: > On Fri, Nov 07, 2008 at 03:46:37PM -0500, David Lively wrote: > > It shouldn't be hard to make this thread-safe using Java synchronized > > methods and statements, but I haven't done that yet. Should I?? > > Well if we can, we probably

Re: [libvirt] [PATCH] Java bindings for domain events

2008-11-12 Thread Daniel Veillard
On Fri, Nov 07, 2008 at 03:46:37PM -0500, David Lively wrote: > The attached patch (against libvirt-java) contains Java bindings for the > new domain event code. It works (see EventTest.java), but there's a > certain amount of hokiness regarding the EventImpl stuff that I'd like > to discuss. I

[libvirt] [PATCH] Java bindings for domain events

2008-11-07 Thread David Lively
The attached patch (against libvirt-java) contains Java bindings for the new domain event code. It works (see EventTest.java), but there's a certain amount of hokiness regarding the EventImpl stuff that I'd like to discuss. Unlike the C and Python interfaces, the Java interface does not currently