public final class LibGraalIsolate extends Object
LibGraalObject
s have a LibGraalIsolate
context.Modifier and Type | Method and Description |
---|---|
static LibGraalIsolate |
current()
Gets the isolate associated with the current thread.
|
long |
getId() |
<T> T |
getSingleton(Class<T> key,
Supplier<T> supplier)
Gets the value corresponding to
key from a key-value store of singleton objects. |
boolean |
isValid() |
String |
toString() |
public long getId()
public static LibGraalIsolate current()
IllegalStateException
- if the current thread is not attached to libgraalpublic <T> T getSingleton(Class<T> key, Supplier<T> supplier)
key
from a key-value store of singleton objects. If
no value corresponding to key
currently exists, then it is computed with
supplier
and inserted in the store.
This is used to obtain objects whose lifetime is bound to the isolate represented by this
object.public boolean isValid()