Class Instrument

java.lang.Object
org.graalvm.polyglot.Instrument

public final class Instrument extends Object
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:
  • Method Details

    • getId

      public String getId()
      Gets the ID clients can use to acquire this instrument.
      Returns:
      the unique ID for this instrument.
      Since:
      19.0
    • getName

      public String getName()
      Gets a human-readable name for this instrument.
      Returns:
      the user-friendly name for this instrument.
      Since:
      19.0
    • getOptions

      public OptionDescriptors getOptions()
      Gets the options available for this instrument.
      Returns:
      the options as OptionDescriptors.
      Since:
      19.0
    • getVersion

      public String getVersion()
      Gets the version of this instrument.
      Returns:
      the version of this instrument.
      Since:
      19.0
    • lookup

      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.
      Type Parameters:
      T - the type of the internal service.
      Parameters:
      type - class of the service that is being requested.
      Returns:
      instance of requested type, null if no such service is available.
      Since:
      19.0
    • getWebsite

      public String getWebsite()
      Gets the website of this instrument.
      Returns:
      the website of this instrument.
      Since:
      22.1.0