Package com.sun.jna
Class CallbackReference
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Provides a reference to an association between a native callback closure
 and a Java 
Callback closure.- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) static final Map<Callback,CallbackReference> (package private) int(package private) Pointer(package private) Cleaner.Cleanable(package private) static final Map<Callback,CallbackReference> (package private) Method(package private) CallbackProxy(package private) Pointer
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Free native resources associated with this callback.protected voiddispose()Deprecated.(package private) static voidDispose of all memory allocated for callbacks.(package private) static Class<?>findCallbackClass(Class<?> type) static CallbackgetCallback(Class<?> type, Pointer p) Return a Callback associated with the given function pointer.static PointerReturn aPointerto the native function address for the given callback.Obtain a pointer to the native glue code for this callback.(package private) static CallbackThreadInitializersetCallbackThreadInitializer(Callback cb, CallbackThreadInitializer initializer) Methods inherited from class java.lang.ref.Referenceclear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
- 
Field Details- 
callbackMap
- 
directCallbackMap
- 
pointerCallbackMap
- 
allocations
- 
cleanableCleaner.Cleanable cleanable
- 
cbstructPointer cbstruct
- 
trampolinePointer trampoline
- 
proxyCallbackProxy proxy
- 
methodMethod method
- 
callingConventionint callingConvention
 
- 
- 
Method Details- 
setCallbackThreadInitializerstatic CallbackThreadInitializer setCallbackThreadInitializer(Callback cb, CallbackThreadInitializer initializer) - Parameters:
- cb- The- Callbackinstance
- initializer- The- CallbackThreadInitializer- if- nullthen the associated initializer instance is removed
- Returns:
- The previous initializer instance (may be null)
 
- 
getCallbackReturn 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.- Throws:
- IllegalStateException- if the given pointer has already been mapped to a callback of a different type.
 
- 
findCallbackClass
- 
getTrampolineObtain a pointer to the native glue code for this callback.
- 
closepublic void close()Free native resources associated with this callback.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
- 
disposeDeprecated.
- 
disposeAllstatic void disposeAll()Dispose of all memory allocated for callbacks.
- 
getFunctionPointerReturn aPointerto the native function address for the given callback.
 
-