Interface GraalPyContextCustomizer

All Superinterfaces:
Ordered
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GraalPyContextCustomizer extends Ordered
Customizes every GraalPy context builder created by Micronaut.

Implementations are loaded with ServiceLoader semantics and invoked in order each time a context is built. Implementations may therefore be invoked multiple times and should be idempotent. A customizer must not build or retain the supplied builder.

Since:
5.2.0
Author:
Micronaut Team
  • Field Summary

    Fields inherited from interface Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    customize(org.graalvm.polyglot.Context.Builder builder)
    Customize a context builder before its context is created.
    default Set<String>
    Returns additional guest languages that must be enabled in the shared engine and contexts.
    default int
     
  • Method Details

    • customize

      void customize(org.graalvm.polyglot.Context.Builder builder)
      Customize a context builder before its context is created.
      Parameters:
      builder - The builder to customize
    • getAdditionalLanguages

      default Set<String> getAdditionalLanguages()
      Returns additional guest languages that must be enabled in the shared engine and contexts.

      Python is always enabled. Implementations should return only languages they require and must ensure the corresponding language distribution is present at runtime.

      Returns:
      The additional Polyglot language identifiers
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface Ordered
      Returns:
      The order of the object. Defaults to zero (no order).