Top Description Inners Constructors Methods
org.graalvm.nativeimage

public final Class Isolates

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, .Objects, org.graalvm.nativeimage.impl.IsolateSupport, org.graalvm.word.UnsignedWord

Support for the creation, access to, and tear-down of isolates.
Since
19.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Isolates.CreateIsolateParameters

Parameters for the creation of an isolate.

public static class
Isolates.IsolateException

An exception thrown in the context of managing isolates.

public static interface
Isolates.ProtectionDomain

Identifies a protection domain for an isolate.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IsolateThread

Returns:

A pointer to the structure representing the newly attached isolate thread.
attachCurrentThread
(Isolate
The isolate to which to attach the current thread.
isolate
)

Attaches the current thread to the passed isolate.

public static IsolateThread

Returns:

A pointer to the structure that represents the current thread in the new isolate.
createIsolate
(Isolates.CreateIsolateParameters
Parameters for the creation of the isolate.
parameters
)

Creates a new isolate with the passed parameters.

public static void
detachThread(IsolateThread
The isolate thread to detach from its isolate.
thread
)

Detaches the passed isolate thread from its isolate and discards any state or context that is associated with it.

public static IsolateThread

Returns:

A pointer to the current thread's structure in the specified isolate or null if the thread is not attached to that isolate.
getCurrentThread
(Isolate
The isolate for which to retrieve the current thread's corresponding structure
isolate
)

Given an isolate to which the current thread is attached, returns the address of the thread's associated isolate thread structure.

public static Isolate

Returns:

A pointer to the isolate, or null.
getIsolate
(IsolateThread
The isolate thread for which to retrieve the isolate.
thread
)

Given an isolate thread structure, determines to which isolate it belongs and returns the address of the isolate structure.

public static void
tearDownIsolate(IsolateThread
IsolateThread of the current thread that is attached to the isolate which is to be torn down.
thread
)

Tears down an isolate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Isolatesback to summary
private Isolates()

Method Detail

attachCurrentThreadback to summary
public static IsolateThread attachCurrentThread(Isolate isolate) throws IsolateException

Attaches the current thread to the passed isolate. If the thread has already been attached, the call provides the thread's existing isolate thread structure.

Parameters
isolate:Isolate

The isolate to which to attach the current thread.

Returns:IsolateThread

A pointer to the structure representing the newly attached isolate thread.

Exceptions
IsolateException:
on error.
Since
19.0
createIsolateback to summary
public static IsolateThread createIsolate(Isolates.CreateIsolateParameters parameters) throws IsolateException

Creates a new isolate with the passed parameters. On success, the current thread is attached to the created isolate, and a pointer to its associated IsolateThread structure is returned.

Parameters
parameters:Isolates.CreateIsolateParameters

Parameters for the creation of the isolate.

Returns:IsolateThread

A pointer to the structure that represents the current thread in the new isolate.

Exceptions
IsolateException:
on error.
Since
19.0
detachThreadback to summary
public static void detachThread(IsolateThread thread) throws IsolateException

Detaches the passed isolate thread from its isolate and discards any state or context that is associated with it. At the time of the call, no code may still be executing in the isolate thread's context. The passed pointer is no longer valid after the method returns.

Parameters
thread:IsolateThread

The isolate thread to detach from its isolate.

Exceptions
IsolateException:
on error.
Since
19.0
getCurrentThreadback to summary
public static IsolateThread getCurrentThread(Isolate isolate) throws IsolateException

Given an isolate to which the current thread is attached, returns the address of the thread's associated isolate thread structure. If the current thread is not attached to the passed isolate, returns null.

Parameters
isolate:Isolate

The isolate for which to retrieve the current thread's corresponding structure

Returns:IsolateThread

A pointer to the current thread's structure in the specified isolate or null if the thread is not attached to that isolate.

Exceptions
IsolateException:
on error.
Since
19.0
getIsolateback to summary
public static Isolate getIsolate(IsolateThread thread) throws IsolateException

Given an isolate thread structure, determines to which isolate it belongs and returns the address of the isolate structure. May return null if the specified isolate thread structure is no longer valid.

Parameters
thread:IsolateThread

The isolate thread for which to retrieve the isolate.

Returns:Isolate

A pointer to the isolate, or null.

Exceptions
IsolateException:
on error.
Since
19.0
tearDownIsolateback to summary
public static void tearDownIsolate(IsolateThread thread) throws IsolateException

Tears down an isolate. Given an IsolateThread for the current thread which must be attached to the isolate to be torn down, waits for any other attached threads to detach from the isolate, then discards the isolate's objects, threads, and any other state or context that is associated with it. The passed pointer is no longer valid after the method returns.

Parameters
thread:IsolateThread

IsolateThread of the current thread that is attached to the isolate which is to be torn down.

Exceptions
IsolateException:
on error.
Since
19.0
org.graalvm.nativeimage back to summary

public final Class Isolates.CreateIsolateParameters

extends Object
Class Inheritance

Parameters for the creation of an isolate.
Since
19.0
See Also
CreateIsolateParameters.Builder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final List<String>
private final String
private final UnsignedWord
private static final Isolates.CreateIsolateParameters
private final Isolates.ProtectionDomain
private final UnsignedWord

Constructor Summary

AccessConstructor and Description
private
CreateIsolateParameters(UnsignedWord reservedAddressSpaceSize, String auxiliaryImagePath, UnsignedWord auxiliaryImageReservedSpaceSize, List<String> arguments, Isolates.ProtectionDomain protectionDomain)

Method Summary

Modifier and TypeMethod and Description
public List<String>
getArguments()

Returns the list of additional isolate arguments.

public String
getAuxiliaryImagePath()

Returns the file path to an auxiliary image which should be loaded in addition to the main image, or null if no such image should be loaded.

public UnsignedWord
getAuxiliaryImageReservedSpaceSize()

Returns the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved.

public static Isolates.CreateIsolateParameters
getDefault()

Returns a CreateIsolateParameters with all default values.

public Isolates.ProtectionDomain
getProtectionDomain()

Returns the memory protection domain to be used for an isolate.

public UnsignedWord
getReservedAddressSpaceSize()

Returns the size in bytes for the reserved virtual address space of the new isolate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
private final List<String> arguments
auxiliaryImagePathback to summary
private final String auxiliaryImagePath
auxiliaryImageReservedSpaceSizeback to summary
private final UnsignedWord auxiliaryImageReservedSpaceSize
DEFAULTback to summary
private static final Isolates.CreateIsolateParameters DEFAULT
protectionDomainback to summary
private final Isolates.ProtectionDomain protectionDomain
reservedAddressSpaceSizeback to summary
private final UnsignedWord reservedAddressSpaceSize

Constructor Detail

CreateIsolateParametersback to summary
private CreateIsolateParameters(UnsignedWord reservedAddressSpaceSize, String auxiliaryImagePath, UnsignedWord auxiliaryImageReservedSpaceSize, List<String> arguments, Isolates.ProtectionDomain protectionDomain)

Method Detail

getArgumentsback to summary
public List<String> getArguments()

Returns the list of additional isolate arguments.

Since
22.1
getAuxiliaryImagePathback to summary
public String getAuxiliaryImagePath()

Returns the file path to an auxiliary image which should be loaded in addition to the main image, or null if no such image should be loaded.

Since
20.1
getAuxiliaryImageReservedSpaceSizeback to summary
public UnsignedWord getAuxiliaryImageReservedSpaceSize()

Returns the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved.

Since
20.1
getDefaultback to summary
public static Isolates.CreateIsolateParameters getDefault()

Returns a CreateIsolateParameters with all default values.

Since
19.0
getProtectionDomainback to summary
public Isolates.ProtectionDomain getProtectionDomain()

Returns the memory protection domain to be used for an isolate.

Since
22.1
getReservedAddressSpaceSizeback to summary
public UnsignedWord getReservedAddressSpaceSize()

Returns the size in bytes for the reserved virtual address space of the new isolate.

Since
19.0
org.graalvm.nativeimage back to summary

public final Class Isolates.CreateIsolateParameters.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.graalvm.nativeimage.Isolates.CreateIsolateParameters.Builder

Builder for a CreateIsolateParameters instance.
Since
19.0

Field Summary

Modifier and TypeField and Description
private final List<String>
private String
private UnsignedWord
private Isolates.ProtectionDomain
private UnsignedWord

Constructor Summary

AccessConstructor and Description
public
Builder()

Creates a new builder with default values.

Method Summary

Modifier and TypeMethod and Description
public Isolates.CreateIsolateParameters.Builder
appendArgument(String argument)

Appends an isolate argument.

public Isolates.CreateIsolateParameters.Builder
auxiliaryImagePath(String filePath)

Sets the file path to an auxiliary image which should be loaded in addition to the main image, or null if no such image should be loaded.

public Isolates.CreateIsolateParameters.Builder
auxiliaryImageReservedSpaceSize(UnsignedWord size)

Sets the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved.

public Isolates.CreateIsolateParameters
build()

Produces the final CreateIsolateParameters with the values set previously by the builder methods.

public Isolates.CreateIsolateParameters.Builder
reservedAddressSpaceSize(UnsignedWord size)

Sets the size in bytes for the reserved virtual address space of the new isolate.

public Isolates.CreateIsolateParameters.Builder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
private final List<String> arguments
auxiliaryImagePathback to summary
private String auxiliaryImagePath
auxiliaryImageReservedSpaceSizeback to summary
private UnsignedWord auxiliaryImageReservedSpaceSize
protectionDomainback to summary
private Isolates.ProtectionDomain protectionDomain
reservedAddressSpaceSizeback to summary
private UnsignedWord reservedAddressSpaceSize

Constructor Detail

Builderback to summary
public Builder()

Creates a new builder with default values.

Since
19.0

Method Detail

appendArgumentback to summary
public Isolates.CreateIsolateParameters.Builder appendArgument(String argument)

Appends an isolate argument. The syntax for arguments is the same as the one that is used on the command-line when starting Native Image (e.g., -XX:+AutomaticReferenceHandling). If the same argument is added multiple times, the last specified value will be used.

Since
22.1
auxiliaryImagePathback to summary
public Isolates.CreateIsolateParameters.Builder auxiliaryImagePath(String filePath)

Sets the file path to an auxiliary image which should be loaded in addition to the main image, or null if no such image should be loaded.

Since
20.1
auxiliaryImageReservedSpaceSizeback to summary
public Isolates.CreateIsolateParameters.Builder auxiliaryImageReservedSpaceSize(UnsignedWord size)

Sets the size in bytes of an address space to reserve for loading an auxiliary image in addition to the main image, or 0 if no space should be reserved.

Since
20.1
buildback to summary
public Isolates.CreateIsolateParameters build()

Produces the final CreateIsolateParameters with the values set previously by the builder methods.

Since
19.0
reservedAddressSpaceSizeback to summary
public Isolates.CreateIsolateParameters.Builder reservedAddressSpaceSize(UnsignedWord size)

Sets the size in bytes for the reserved virtual address space of the new isolate.

Since
19.0
setProtectionDomainback to summary
public Isolates.CreateIsolateParameters.Builder setProtectionDomain(Isolates.ProtectionDomain domain)

Sets the ProtectionDomain for an isolate.

Since
22.1
org.graalvm.nativeimage back to summary

public final Class Isolates.IsolateException

extends RuntimeException
Class Inheritance

An exception thrown in the context of managing isolates.
Since
19.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
IsolateException(String message)

Constructs a new exception with the specified detail message.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

IsolateExceptionback to summary
public IsolateException(String message)

Constructs a new exception with the specified detail message.

Since
19.0
org.graalvm.nativeimage back to summary

public Interface Isolates.ProtectionDomain


Identifies a protection domain for an isolate. A protection domain may be used by a MemoryProtectionKeyProvider in connection with underlying MMU hardware such as Memory Protection Keys.
Since
22.1

Field Summary

Modifier and TypeField and Description
public static final Isolates.ProtectionDomain
NEW_DOMAIN

Creates a new protection domain if passed to the CreateIsolateParameters.Builder.

public static final Isolates.ProtectionDomain
NO_DOMAIN

Do not use a protection domain.

Field Detail

NEW_DOMAINback to summary
public static final Isolates.ProtectionDomain NEW_DOMAIN

Creates a new protection domain if passed to the CreateIsolateParameters.Builder.

Since
22.1
NO_DOMAINback to summary
public static final Isolates.ProtectionDomain NO_DOMAIN

Do not use a protection domain.

Since
22.1