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 ObjectHandles
create()
Creates a new set of handles.Creates a handle to the specified object.void
destroy
(ObjectHandle handle) Destroys the given handle.<T> T
get
(ObjectHandle handle) Extracts the object from a given handle.static ObjectHandles
A 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 returnedObjectHandles
instance 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
-