Top Description Fields Constructors Methods
org.graalvm.polyglot

public final Class Instrument

extends Object
Class Inheritance
Imports
org.graalvm.options.OptionDescriptors, org.graalvm.polyglot.impl.AbstractPolyglotImpl.AbstractInstrumentDispatch

A handle for an instrument installed in an engine. The instrument is usable from other threads. The handle provides access to the metadata of the instrument and allows to lookup instrument specific services.

All methods here, as well as instrumentation services in general, can be used safely from any thread.

Since
19.0
See Also
Engine#getInstruments()

Field Summary

Modifier and TypeField and Description
pack-priv final AbstractPolyglotImpl.AbstractInstrumentDispatch
pack-priv final Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the unique ID for this instrument.
getId
()

Gets the ID clients can use to acquire this instrument.

public String

Returns:

the user-friendly name for this instrument.
getName
()

Gets a human-readable name for this instrument.

public OptionDescriptors

Returns:

the options as OptionDescriptors.
getOptions
()

Gets the options available for this instrument.

public String

Returns:

the version of this instrument.
getVersion
()

Gets the version of this instrument.

public String

Returns:

the website of this instrument.
getWebsite
()

Gets the website of this instrument.

public <
the type of the internal service.
T
>
T

Returns:

instance of requested type, null if no such service is available.
lookup
(Class<T>
class of the service that is being requested.
type
)

Looks up an additional internal service that is provided by this instrument using a Java type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dispatchback to summary
pack-priv final AbstractPolyglotImpl.AbstractInstrumentDispatch dispatch
receiverback to summary
pack-priv final Object receiver

Constructor Detail

Instrumentback to summary
pack-priv Instrument(AbstractPolyglotImpl.AbstractInstrumentDispatch dispatch, Object receiver)

Method Detail

getIdback to summary
public String getId()

Gets the ID clients can use to acquire this instrument.

Returns:String

the unique ID for this instrument.

Since
19.0
getNameback to summary
public String getName()

Gets a human-readable name for this instrument.

Returns:String

the user-friendly name for this instrument.

Since
19.0
getOptionsback to summary
public OptionDescriptors getOptions()

Gets the options available for this instrument.

Returns:OptionDescriptors

the options as OptionDescriptors.

Since
19.0
getVersionback to summary
public String getVersion()

Gets the version of this instrument.

Returns:String

the version of this instrument.

Since
19.0
getWebsiteback to summary
public String getWebsite()

Gets the website of this instrument.

Returns:String

the website of this instrument.

Since
22.1.0
lookupback to summary
public <T> T lookup(Class<T> type)

Looks up an additional internal service that is provided by this instrument using a Java type. Note that the services returned by this method are implementation specific and subject to change without notice.

Parameters
<T>
the type of the internal service.
type:Class<T>

class of the service that is being requested.

Returns:T

instance of requested type, null if no such service is available.

Since
19.0