11 messages in net.java.dev.jna.usersNativeLibrary Usage
FromSent OnAttachments
Christine GrudeckiJul 26, 2007 7:11 am 
Timothy WallJul 26, 2007 8:35 am 
Christine GrudeckiJul 26, 2007 12:52 pm 
Timothy WallJul 26, 2007 1:21 pm 
pzab...@poczta.onet.plJul 27, 2007 8:57 am 
Timothy WallJul 27, 2007 11:24 am 
Timothy WallJul 30, 2007 3:41 am 
Timothy WallJul 30, 2007 7:54 am 
Timothy WallJul 30, 2007 8:58 am 
Christine GrudeckiJul 30, 2007 9:24 am 
Timothy WallJul 30, 2007 10:49 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:NativeLibrary UsageActions...
From:Christine Grudecki (Chri@vayan.com)
Date:Jul 26, 2007 7:11:33 am
List:net.java.dev.jna.users

Currently, I'm opening and using the library as per the documentation. However, my server is crashing after a few iterations of my program because there is no way to close the library after opening it during each iteration (it runs on a scheduler every 10 minutes). I think I need to be using the NativeLibrary class since it has the Finalize method, but I can't find any documentation or examples of how to use it instead of the Library interface.

Can I use the Library interface in conjunction with the NativeLibrary class? Or are they mutually exclusive? How do I convert the example to use

Here are snippets of my code:

public interface MyLibrary extends Library {

MyLibrary INSTANCE = (MyLibrary) Native.loadLibrary("/usr/local/lib/MyLibrary.so", MyLibrary.class); //Some of my library's native methods void myLib_init(); int myLibCheck(String messageText, PointerByReference emailAddress, String emailIgnoreList, String key);

//I haven't included all of the methods of my system object to save space

}

And in another class, I call MyLibrary:

myLibrary = MyLibrary.INSTANCE; myLibrary.myLib_init(); int return = myLibCheck(message, emailAddress, "", keyString);