Package com.exonum.binding.core.proxy
Interface CloseableNativeProxy
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Subinterfaces:
Database
- All Known Implementing Classes:
AbstractCloseableNativeProxy
,NodeProxy
,TemporaryDb
,TestKit
public interface CloseableNativeProxy
extends java.lang.AutoCloseable
A proxy of a native object that must be explicitly closed.
You must close a native proxy when it is no longer needed to release any native resources (e.g., destroy a native object). You may use a try-with-resources statement to do that in orderly fashion. When a proxy is closed, it becomes invalid.
-
Method Summary
Modifier and Type Method Description void
close()
Closes the native proxy and releases any native resources associated with this proxy.
-
Method Details
-
close
void close()Closes the native proxy and releases any native resources associated with this proxy.Notifies the native code that the native object is no longer needed, and may be safely destroyed. Once closed, the proxy becomes invalid.
The implementations must be idempotent — do nothing on consecutive invocations.
- Specified by:
close
in interfacejava.lang.AutoCloseable
-