Annotation Interface TruffleInstrument.Registration

Enclosing class:
TruffleInstrument

@Retention(RUNTIME) @Target(TYPE) public static @interface TruffleInstrument.Registration
Annotation that registers an instrument implementations for automatic discovery.
Since:
0.12
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A custom machine identifier for this instrument.
    boolean
    Specifies whether the instrument is accessible using the polyglot API.
    Class<? extends InternalResource>[]
    Declarative list of InternalResource classes that is associated with this instrument.
    The name of the instrument in an arbitrary format for humans.
    Specifies the most strict sandbox policy in which the instrument can be used.
    Class<?>[]
    Declarative list of classes this instrument is known to provide.
    The version for instrument in an arbitrary format.
    A link to a website with more information about the instrument.
  • Element Details

    • id

      String id
      A custom machine identifier for this instrument. If not defined then the fully qualified class name is used.
      Since:
      0.12
      Default:
      ""
    • name

      String name
      The name of the instrument in an arbitrary format for humans.
      Since:
      0.12
      Default:
      ""
    • version

      String version
      The version for instrument in an arbitrary format. It inherits from Engine.getVersion() by default.
      Since:
      0.12
      Default:
      "inherit"
    • internal

      boolean internal
      Specifies whether the instrument is accessible using the polyglot API. Internal instruments are only accessible from other instruments or guest languages.
      Since:
      0.27
      Default:
      false
    • services

      Class<?>[] services
      Declarative list of classes this instrument is known to provide. The instrument is supposed to override its onCreate method and instantiate and register all here in defined services.

      Instruments automatically get created when their registered service is requested.

      Returns:
      list of service types that this instrument can provide
      Since:
      0.25
      Default:
      {}
    • website

      String website
      A link to a website with more information about the instrument. Will be shown in the help text of GraalVM launchers.

      The link can contain the following substitutions:

      ${graalvm-version}
      the current GraalVM version. Optionally, a format string can be provided for the version using ${graalvm-version:format}. See Version.format(java.lang.String).
      ${graalvm-website-version}
      the current GraalVM version in a format suitable for links to the GraalVM reference manual. The exact format may change without notice.
      Since:
      22.1.0
      Default:
      ""
    • sandbox

      SandboxPolicy sandbox
      Specifies the most strict sandbox policy in which the instrument can be used. The instrument can be used in an engine with the specified sandbox policy or a weaker one. For example, if an instrument specifies ISOLATED policy, it can be used in an engine configured with sandbox policy TRUSTED, CONSTRAINED or ISOLATED. But it cannot be used in an engine configured with the UNTRUSTED sandbox policy.
      Since:
      23.0
      See Also:
      Default:
      TRUSTED
    • internalResources

      Class<? extends InternalResource>[] internalResources
      Declarative list of InternalResource classes that is associated with this instrument. Use the internalResources attribute solely for registering required internal resources. Optional internal resources should provide the associated instrument identifier using the InternalResource.Id.componentId() method. To unpack all resources of an instrument embedders may use Engine.copyResources(Path, String...).
      Since:
      23.1
      See Also:
      Default:
      {}