Class AbstractNativeProxy

java.lang.Object
com.exonum.binding.core.proxy.AbstractNativeProxy
Direct Known Subclasses:
AbstractCloseableNativeProxy, EntryIndexProxy, KeySetIndexProxy, ListIndexProxy, MapIndexProxy, ProofListIndexProxy, ProofMapIndexProxy, ValueSetIndexProxy, View

public abstract class AbstractNativeProxy
extends Object
A base class of a native proxy.
  • Field Details

  • Constructor Details

  • Method Details

    • getNativeHandle

      protected long getNativeHandle()
      Returns a handle to the native object if it may be safely used to access the native object. Equivalent to nativeHandle.get().

      The returned value shall only be passed as an argument to native methods.

      Warning: do not cache the return value, as you won't be able to catch use-after-free.

      Throws:
      IllegalStateException - if the native handle is invalid (closed or nullptr)
    • isValidHandle

      protected final boolean isValidHandle()
      Returns true if this proxy has a valid native handle.