public final class NativeMethods
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
NativeMethods.ResourceHolder |
Modifier and Type | Field and Description |
---|---|
private NativeMethods.ResourceHolder |
memory |
private static java.util.Map<java.lang.Class,NativeMethods> |
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.
|
Modifier | Constructor and Description |
---|---|
private |
NativeMethods(NativeMethods.ResourceHolder memory) |
Modifier and Type | Method and Description |
---|---|
static void |
register(java.lang.Class clazz,
java.util.List<NativeMethod> methods)
Registers the native methods for a class.
|
static void |
unregister(java.lang.Class clazz)
Removes all native method attachments for the specified class.
|
private static final java.util.Map<java.lang.Class,NativeMethods> registeredMethods
private final NativeMethods.ResourceHolder memory
private NativeMethods(NativeMethods.ResourceHolder memory)
public static final void register(java.lang.Class clazz, java.util.List<NativeMethod> methods)
clazz
- The java class to register the native methods for.methods
- The list of methods to attach to the class.public static final void unregister(java.lang.Class clazz)
clazz
- The class to unregister the native methods on.