Skip navigation links
JNA API 5.13.0
com.sun.jna

Class CallbackReference

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    public class CallbackReference
    extends java.lang.ref.WeakReference<Callback>
    implements java.io.Closeable
    Provides a reference to an association between a native callback closure and a Java Callback closure.
    • Method Detail

      • getCallback

        public 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.
      • findCallbackClass

        static java.lang.Class<?> findCallbackClass(java.lang.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.
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
      • dispose

        @Deprecated
        protected void dispose()
        Deprecated. 
      • 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.
JNA API 5.13.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.