Elide GraalVM25.6.0-elide.4
All types
Versions and modules

ObjectHandles

Javainterfacein org.graalvm.nativeimagesince 19.0

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.

Methods5

static ObjectHandles getGlobal()

getGlobal

staticsince 19.0
static ObjectHandles getGlobal()

A set of handles that is kept alive globally.

Returns

ObjectHandles
No description.
static ObjectHandles create()

create

staticsince 19.0
static ObjectHandles create()

Creates a new set of handles. Objects are kept alive until the returned ObjectHandles instance gets unreachable.

Returns

ObjectHandles
No description.
ObjectHandle create(Object)

create

since 19.0
ObjectHandle create(Object object)

Creates a handle to the specified object. The object is kept alive by the garbage collector at least until destroy is called for the returned handle. The object can be null.

Parameters

objectObject
No description.

Returns

ObjectHandle
No description.
T get(ObjectHandle)

get

since 19.0
<T> T get(ObjectHandle handle)

Extracts the object from a given handle.

Parameters

handleObjectHandle
No description.

Returns

T
No description.
void destroy(ObjectHandle)

destroy

since 19.0
void destroy(ObjectHandle handle)

Destroys the given handle. After calling this method, the handle must not be used anymore.

Parameters

handleObjectHandle
No description.