Philip Jenvey wrote:
On Sep 4, 2007, at 2:00 PM, Charles Oliver Nutter wrote:
Timothy Wall wrote:
That's generated by the first line of loadLibrary; I don't think there
are any knock-on effects if you take it out. It's mostly a relic of
the
original version, and probably not strictly required.
So I take it you want to re-use the POSIX interface with different
implementations, only one of which would be JNA-based?
Bingo.
I was pondering this same issue last night, for Jython.
What I realized was you can define your base interface, without JNA:
interface Posix {
int chmod(String filename, int mode);
}
Then subclass it and JNA's Library for the optional JNA version (which
build scripts could avoid compiling if the JNA jar isn't present):
Hmm. Given that JRuby already uses asm, it could use this approach + an
asm generated subclass that includes the Library interface if it is
available at runtime.
Its a lot simpler if JNA just drops the requirement that the passed in
class doesn't extends Library, assuming that doesn't break anything.
The real question is, why are you guys doing this in java, instead of
directly in ruby or python code?