Class NativeMethods
java.lang.Object
com.kenai.jffi.NativeMethods
Utility class to register native methods on a class
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NativeMethods.ResourceHolderprivate static final Map<Class, NativeMethods> Store a link from the class to the native method holder in a weak hash map, so as long as the class remains alive, the native memory for the structures remains alive. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidregister(Class clazz, List<NativeMethod> methods) Registers the native methods for a class.static final voidunregister(Class clazz) Removes all native method attachments for the specified class.
-
Field Details
-
registeredMethods
Store a link from the class to the native method holder in a weak hash map, so as long as the class remains alive, the native memory for the structures remains alive. This doesn't seem to be necessary on sun's jvm, but best do it to be safe. -
memory
-
-
Constructor Details
-
NativeMethods
-
-
Method Details
-
register
Registers the native methods for a class.- Parameters:
clazz- The java class to register the native methods for.methods- The list of methods to attach to the class.
-
unregister
Removes all native method attachments for the specified class.- Parameters:
clazz- The class to unregister the native methods on.
-