Package com.sun.jna

Klasse CallbackReference

Alle implementierten Schnittstellen:
Closeable, AutoCloseable

public class CallbackReference extends WeakReference<Callback> implements Closeable
Provides a reference to an association between a native callback closure and a Java Callback closure.
  • Felddetails

  • Methodendetails

    • setCallbackThreadInitializer

      static CallbackThreadInitializer setCallbackThreadInitializer(Callback cb, CallbackThreadInitializer initializer)
      Parameter:
      cb - The Callback instance
      initializer - The CallbackThreadInitializer - if null then the associated initializer instance is removed
      Gibt zurück:
      The previous initializer instance (may be null)
    • 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.
      Löst aus:
      IllegalStateException - if the given pointer has already been mapped to a callback of a different type.
    • findCallbackClass

      static Class<?> findCallbackClass(Class<?> type)
    • getTrampoline

      public Pointer getTrampoline()
      Obtain a pointer to the native glue code for this callback.
    • close

      public void close()
      Free native resources associated with this callback.
      Angegeben von:
      close in Schnittstelle AutoCloseable
      Angegeben von:
      close in Schnittstelle Closeable
    • dispose

      @Deprecated protected void dispose()
      Veraltet.
    • disposeAll

      static void disposeAll()
      Dispose of all memory allocated for callbacks.
    • getFunctionPointer

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