Class ProxyDestructor

java.lang.Object
com.exonum.binding.core.proxy.ProxyDestructor
All Implemented Interfaces:
CancellableCleanAction<Class<?>>, CleanAction<Class<?>>

public final class ProxyDestructor
extends Object
implements CancellableCleanAction<Class<?>>
ProxyDestructor is a clean action that destroys a native proxy and closes its native handle.

Most native proxies do not implement any interface (e.g., CloseableNativeProxy) and use this class so that there is no public #close method available in the interface of the proxy, making the risk of misuse smaller.

All method parameters are non-null by default.

This class is not thread-safe.

  • Constructor Details

    • ProxyDestructor

      public ProxyDestructor​(NativeHandle nativeHandle, Class<?> proxyClass, LongConsumer destructorFunction)
      Creates a new destructor of a native proxy.
      Parameters:
      nativeHandle - a handle to the native object
      proxyClass - a class of the proxy
      destructorFunction - a clean function to perform
  • Method Details