Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2011 15:42:39 +0100
From:      Matthias <info@o-notation.org>
To:        freebsd-java@freebsd.org
Subject:   openjdk and jni
Message-ID:  <4EEF4D5F.4090508@o-notation.org>

next in thread | raw e-mail | index | archive | help
Hello group,
for a project i try to port the JNotify lib to FreeBSD. I use the 
kevents to get the file events; i put it in a jni-lib:
There is add-Method to register the event with path and 
eventmask(blocking mode), returning the filehandle. By registering the 
event i add a struct to kevent.udate for additional information(fh, 
mask, path).
A callback-method is called from jni-lib with values of the 
kevent.udata-struct, when a event is fired. That's the idea...
The Problem:
When i register different paths directly via the Java-Jni-Wrapper-Class, 
every event is fired and i get all the values of the callback-method.
When i register the same paths via the 
JNotify-wrapper-class->Java-Jni-Wrapper-Class, the events are fired too, 
but the values of the callback-method are totally wrong(not the values 
of the first registered event). All parameters showing nonsens.
Tests are showing, that the values of the struct returned by the kevent 
are already bad.

Are there any limitations of openjdk and jni? Why is it running fine 
when using the java-jni-class and using a wrapper-class the results are 
nonsens?

Any hints are welcome...

Matthias




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EEF4D5F.4090508>