Package org.graalvm.nativeimage
Interface ObjectHandles
public interface ObjectHandles
Manages a set of
ObjectHandles. The handles returned by create() are bound to the
creating handle set, i.e., the handle can only be accessed and destroyed using the exact same handle set used for creation.- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectHandlescreate()Creates a new set of handles.Creates a handle to the specified object.voiddestroy(ObjectHandle handle) Destroys the given handle.<T> Tget(ObjectHandle handle) Extracts the object from a given handle.static ObjectHandlesA set of handles that is kept alive globally.
-
Method Details
-
getGlobal
A set of handles that is kept alive globally.- Since:
- 19.0
-
create
Creates a new set of handles. Objects are kept alive until the returnedObjectHandlesinstance gets unreachable.- Since:
- 19.0
-
create
Creates a handle to the specified object. The object is kept alive by the garbage collector at least untildestroy(org.graalvm.nativeimage.ObjectHandle)is called for the returned handle. The object can be null.- Since:
- 19.0
-
get
Extracts the object from a given handle.- Since:
- 19.0
-
destroy
Destroys the given handle. After calling this method, the handle must not be used anymore.- Since:
- 19.0
-