Logo Search packages:      
Sourcecode: libjna-java version File versions  Download package

com::sun::jna::Native Class Reference

List of all members.

Detailed Description

Provides generation of invocation plumbing for a defined native library interface. Also provides various utilities for native operations.

getTypeMapper and getStructureAlignment are provided to avoid having to explicitly pass these parameters to Structures, which would require every Structure which requires custom mapping or alignment to define a constructor and pass parameters to the superclass. To avoid lots of boilerplate, the base Structure constructor figures out these properties based on its enclosing interface.

Library Loading

When JNA classes are loaded, the native shared library (jnidispatch) is loaded as well. An attempt is made to load it from the system library path using System#loadLibrary. If not found, the appropriate library will be extracted from the class path into a temporary directory and loaded from there. If your system has additional security constraints regarding execution or load of files (SELinux, for example), you should probably install the native library in an accessible location and configure your system accordingly, rather than relying on JNA to extract the library from its own jar file.

See also:
Todd Fast, todd.fast@sun.com


Definition at line 71 of file Native.java.

Static Public Member Functions

static Pointer getByteBufferPointer (ByteBuffer b)
static long getComponentID (Component c) throws HeadlessException
static Pointer getComponentPointer (Component c) throws HeadlessException
static native Pointer getDirectBufferPointer (Buffer b)
static int getLastError ()
static Map getLibraryOptions (Class type)
static int getNativeSize (Class cls)
static synchronized native boolean getPreserveLastError ()
static int getStructureAlignment (Class cls)
static TypeMapper getTypeMapper (Class cls)
static String getWebStartLibraryPath (String libName)
static long getWindowID (Window w) throws HeadlessException
static Pointer getWindowPointer (Window w) throws HeadlessException
static synchronized native boolean isProtected ()
static boolean isSupportedNativeType (Class cls)
static Object loadLibrary (String name, Class interfaceClass, Map libOptions)
static Object loadLibrary (String name, Class interfaceClass)
static void main (String[] args)
static native void setLastError (int code)
static synchronized native void setPreserveLastError (boolean enable)
static synchronized native void setProtected (boolean enable)
static Library synchronizedLibrary (final Library library)
static String toString (char[] buf)
static String toString (byte[] buf)

Static Public Attributes

static final int LONG_SIZE
static final int POINTER_SIZE
static final int WCHAR_SIZE

Static Package Functions

 [static initializer]
static Class findLibraryClass (Class cls)
static byte[] getBytes (String s)
static void updateLastError (int e)

Static Private Member Functions

static native String getAPIChecksum ()
static String getNativeLibraryResourcePath ()
static native String getNativeVersion ()
static native long getWindowHandle0 (Component c)
static native void initIDs ()
static boolean loadInstance (Class cls)
static void loadNativeLibrary ()
static native int longSize ()
static native int pointerSize ()
static native int wideCharSize ()

Static Private Attributes

static Map alignments = new WeakHashMap()
static final ThreadLocal lastError
static Map libraries = new WeakHashMap()
static Map options = new WeakHashMap()
static Map typeMappers = new WeakHashMap()


class  DeleteNativeLibrary

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index