public final class LibGraalScope extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
LibGraalScope.DetachAction
Denotes the detach action to perform when closing a
LibGraalScope. |
| Constructor and Description |
|---|
LibGraalScope()
Shortcut for calling
LibGraalScope.LibGraalScope(DetachAction) with an argument of
LibGraalScope.DetachAction.DETACH_RUNTIME. |
LibGraalScope(LibGraalScope.DetachAction detachAction)
Enters a scope for making calls into libgraal.
|
LibGraalScope(long isolateAddress)
Enters a scope for making calls into an existing libgraal isolate.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static LibGraalScope |
current()
Gets the current scope.
|
int |
getDepth()
Returns the nesting depth of this
LibGraalScope object. |
LibGraalIsolate |
getIsolate()
Gets the isolate associated with this scope.
|
static long |
getIsolateThread()
Gets the isolate thread associated with the current thread.
|
long |
getIsolateThreadAddress()
Gets the address of the isolate thread associated with this scope.
|
String |
toString() |
public LibGraalScope()
LibGraalScope.LibGraalScope(DetachAction) with an argument of
LibGraalScope.DetachAction.DETACH_RUNTIME.public LibGraalScope(LibGraalScope.DetachAction detachAction)
IllegalStateException - if libgraal is unavailable
or LibGraal.inLibGraal() returns truepublic LibGraalScope(long isolateAddress)
IllegalStateException - if libgraal is unavailable
or LibGraal.inLibGraal() returns truepublic static LibGraalScope current()
IllegalStateException - if the current thread is not in an opened scopepublic static long getIsolateThread()
IllegalStateException - if the current thread is not attached to libgraalpublic LibGraalIsolate getIsolate()
public long getIsolateThreadAddress()
public void close()
close in interface AutoCloseablepublic int getDepth()
LibGraalScope object.