Package com.sun.jna
Class CallbackReference
- java.lang.Object
- 
- java.lang.ref.Reference<T>
- 
- java.lang.ref.WeakReference<Callback>
- 
- com.sun.jna.CallbackReference
 
 
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description (package private) static classCallbackReference.AttachOptions
 - 
Field SummaryFields Modifier and Type Field Description (package private) static java.util.Map<java.lang.Object,java.lang.Object>allocations(package private) static java.util.Map<Callback,CallbackReference>callbackMap(package private) intcallingConvention(package private) Pointercbstruct(package private) static java.util.Map<Callback,CallbackReference>directCallbackMap(package private) java.lang.reflect.Methodmethod(package private) static java.util.Map<Pointer,java.lang.ref.Reference<Callback>[]>pointerCallbackMap(package private) CallbackProxyproxy(package private) Pointertrampoline
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddispose()Free native resources associated with this callback.(package private) static voiddisposeAll()Dispose of all memory allocated for callbacks.protected voidfinalize()Free native resources associated with this callback when GC'd.(package private) static java.lang.Class<?>findCallbackClass(java.lang.Class<?> type)static CallbackgetCallback(java.lang.Class<?> type, Pointer p)Return a Callback associated with the given function pointer.static PointergetFunctionPointer(Callback cb)Return aPointerto the native function address for the given callback.PointergetTrampoline()Obtain a pointer to the native glue code for this callback.(package private) static CallbackThreadInitializersetCallbackThreadInitializer(Callback cb, CallbackThreadInitializer initializer)
 
- 
- 
- 
Field Detail- 
callbackMapstatic final java.util.Map<Callback,CallbackReference> callbackMap 
 - 
directCallbackMapstatic final java.util.Map<Callback,CallbackReference> directCallbackMap 
 - 
pointerCallbackMapstatic final java.util.Map<Pointer,java.lang.ref.Reference<Callback>[]> pointerCallbackMap 
 - 
allocationsstatic final java.util.Map<java.lang.Object,java.lang.Object> allocations 
 - 
cbstructPointer cbstruct 
 - 
trampolinePointer trampoline 
 - 
proxyCallbackProxy proxy 
 - 
methodjava.lang.reflect.Method method 
 - 
callingConventionint callingConvention 
 
- 
 - 
Method Detail- 
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)
 
 - 
getCallbackpublic static Callback getCallback(java.lang.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.- Throws:
- java.lang.IllegalStateException- if the given pointer has already been mapped to a callback of a different type.
 
 - 
findCallbackClassstatic java.lang.Class<?> findCallbackClass(java.lang.Class<?> type) 
 - 
getTrampolinepublic Pointer getTrampoline() Obtain a pointer to the native glue code for this callback.
 - 
finalizeprotected void finalize() Free native resources associated with this callback when GC'd.- Overrides:
- finalizein class- java.lang.Object
 
 - 
disposeprotected void dispose() Free native resources associated with this callback.
 - 
disposeAllstatic void disposeAll() Dispose of all memory allocated for callbacks.
 
- 
 
-