PolyglotEngineConfiguration

This class acts as the root of the engine configuration DSL, allowing plugins to be installed and exposing general features such as enabling support for specific languages.

Instances of this class cannot be created manually; instead, they are provided by the PolyglotEngine method, which serves as entry point for the DSL.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Lists the access privileges that can be conceded to guest code over host resources, such as environment variables, or file system (IO).

Properties

Link copied to clipboard

The access granted to guest code over host resources, such as environment variables and the file system.

Link copied to clipboard

Information about the platform hosting the runtime.

Link copied to clipboard
abstract val hostRuntime: HostRuntime

Information about the runtime engine.

Functions

Link copied to clipboard
abstract fun args(args: Array<String>)

Set the main entrypoint arguments to expose to guest languages.

Link copied to clipboard
abstract fun blockUntilReady()

Block until this configuration has finished bootstrapping the GraalVM guest context; this will wait until all init tasks for all plugins have completed.

Link copied to clipboard
abstract fun <C : Any, I : Any> configure(plugin: EnginePlugin<C, I>, configure: C.() -> Unit = { })

Lazily configure a plugin for use.

Link copied to clipboard
abstract fun enableLanguage(language: GuestLanguage)

Enables support for the specified language on all contexts created by the engine.

Link copied to clipboard
fun <C : Any, T : Any> PluginRegistry.getOrInstall(plugin: EnginePlugin<C, T>, configure: C.() -> Unit = { }): T

Returns the installed plugin instance from the registry, or throws IllegalStateException of no plugin instance is found.

Link copied to clipboard
abstract fun <C : Any, I : Any> install(plugin: EnginePlugin<C, I>, configure: C.() -> Unit = { }): I

Install a plugin and configure it.

Link copied to clipboard
abstract fun <T> plugin(key: EnginePlugin.Key<T>): T?

Retrieve a plugin instance identified by the provided key from this registry. If no instance is registered for that key, null will be returned.

Link copied to clipboard

Returns the installed plugin instance from the registry, or null if this plugin is not installed.

Link copied to clipboard
abstract fun registeredBundles(): List<URL>

Return the current list of resources which should be made available for this plug-in; the resulting list is a read-only copy.

Link copied to clipboard

Returns the plugin instance associated with the given key, or throws IllegalStateException of no plugin instance is found.

Returns the installed plugin instance from the registry, or throws IllegalStateException of no plugin instance is found.