12 messages in net.java.dev.jna.usersRe: [jna-users] Re: Requiring Library...
FromSent OnAttachments
Charles Oliver NutterSep 4, 2007 8:36 am 
Timothy WallSep 4, 2007 9:01 am 
Charles Oliver NutterSep 4, 2007 9:50 am 
Timothy WallSep 4, 2007 10:29 am 
Charles Oliver NutterSep 4, 2007 12:59 pm 
Wayne MeissnerSep 4, 2007 7:13 pm 
Philip JenveySep 4, 2007 9:38 pm 
Wayne MeissnerSep 4, 2007 10:01 pm 
Charles Oliver NutterSep 4, 2007 10:40 pm 
Wayne MeissnerSep 4, 2007 11:41 pm 
Charles Oliver NutterSep 5, 2007 12:04 am 
Timothy WallSep 5, 2007 5:45 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: Requiring Library superinterface?Actions...
From:Wayne Meissner (wmei@gmail.com)
Date:Sep 4, 2007 10:01:26 pm
List:net.java.dev.jna.users

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?