There may be an alternative.
I m doing something similar: In an application I monitor 4 mice for clicks. Those clicks generate interrupts but I m happy enough not to deal with them directly from Java.
Under Linux, it turns out there are device files (/dev/input/mouse#
) that spew a bunch of characters when something happens with the mouse. I have a Thread for each one with a FileReader blocking on a read. Once characters arrive, the appertaining thread unblocks and I can do whatever processing I like.
So the idea is: If possible, find a way to get a device driver to make the data accessible to you in file/device form, then you can access it from Java using just IO calls from the Java library, with no weird bit-twiddling code and C required in between.