com.sun.jna

Class CallbackReference

class CallbackReference extends WeakReference

Provides a reference to an association between a native callback closure and a Java Callback closure.
Field Summary
static Mapallocations
static MapcallbackMap
Pointercbstruct
static MapdirectCallbackMap
Methodmethod
CallbackProxyproxy
Method Summary
protected voidfinalize()
Free native resources associated with this callback.
static ClassfindCallbackClass(Class type)
Find the first instance of an interface which implements the Callback interface or an interface derived from Callback, which defines an appropriate callback method.
static CallbackgetCallback(Class type, Pointer p)
Return a Callback associated with the given function pointer.
static PointergetFunctionPointer(Callback cb)
Return a Pointer to the native function address for the given callback.
PointergetTrampoline()
Obtain a pointer to the native glue code for this callback.

Field Detail

allocations

static final Map allocations

callbackMap

static final Map callbackMap

cbstruct

Pointer cbstruct

directCallbackMap

static final Map directCallbackMap

method

Method method

proxy

CallbackProxy proxy

Method Detail

finalize

protected void finalize()
Free native resources associated with this callback.

findCallbackClass

static Class findCallbackClass(Class type)
Find the first instance of an interface which implements the Callback interface or an interface derived from Callback, which defines an appropriate callback method.

getCallback

public static Callback getCallback(Class type, Pointer p)
Return a Callback associated with the given function pointer. If the pointer refers to a Java callback trampoline, return the original Java Callback. Otherwise, return a proxy to the native function pointer.

getFunctionPointer

public static Pointer getFunctionPointer(Callback cb)
Return a Pointer to the native function address for the given callback.

getTrampoline

public Pointer getTrampoline()
Obtain a pointer to the native glue code for this callback.
Copyright © 2007-2009 Timothy Wall. All Rights Reserved.