Top Description Methods
org.graalvm.nativeimage

public Interface ObjectHandles

Imports
org.graalvm.nativeimage.impl.ObjectHandlesSupport

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 TypeMethod and Description
public static ObjectHandles
create()

Creates a new set of handles.

public ObjectHandle
create(Object object)

Creates a handle to the specified object.

public void
destroy(ObjectHandle handle)

Destroys the given handle.

public <T> T
get(ObjectHandle handle)

Extracts the object from a given handle.

public static ObjectHandles
getGlobal()

A set of handles that is kept alive globally.

Method Detail

createback to summary
public static ObjectHandles create()

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

Since
19.0
createback to summary
public 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.

Since
19.0
destroyback to summary
public void destroy(ObjectHandle handle)

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

Since
19.0
getback to summary
public <T> T get(ObjectHandle handle)

Extracts the object from a given handle.

Since
19.0
getGlobalback to summary
public static ObjectHandles getGlobal()

A set of handles that is kept alive globally.

Since
19.0