Interface ContextsListener


public interface ContextsListener
Listener to be notified about changes of contexts in guest language application.

Use Instrumenter.attachContextsListener(com.oracle.truffle.api.instrumentation.ContextsListener, boolean) to register an implementation of this listener. Use EventBinding.dispose() to unregister.

The listener gets called when a new context is created or disposed and when individual languages are initialized or disposed in that context.

Since:
0.30
See Also:
  • Method Details

    • onContextCreated

      void onContextCreated(TruffleContext context)
      Notifies about creation of a new polyglot context.
      Since:
      0.30
    • onLanguageContextCreate

      default void onLanguageContextCreate(TruffleContext context, LanguageInfo language)
      Notifies before creation of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context is being created
      Since:
      21.1
    • onLanguageContextCreated

      void onLanguageContextCreated(TruffleContext context, LanguageInfo language)
      Notifies about creation of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context was created
      Since:
      0.30
    • onLanguageContextCreateFailed

      default void onLanguageContextCreateFailed(TruffleContext context, LanguageInfo language)
      Notifies after failed creation of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context creation failed
      Since:
      21.1
    • onLanguageContextInitialize

      default void onLanguageContextInitialize(TruffleContext context, LanguageInfo language)
      Notifies before initialization of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context is being initialized
      Since:
      21.1
    • onLanguageContextInitialized

      void onLanguageContextInitialized(TruffleContext context, LanguageInfo language)
      Notifies about initialization of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context was initialized
      Since:
      0.30
    • onLanguageContextInitializeFailed

      default void onLanguageContextInitializeFailed(TruffleContext context, LanguageInfo language)
      Notifies after failed initialization of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context initialization failed
      Since:
      21.1
    • onLanguageContextFinalized

      void onLanguageContextFinalized(TruffleContext context, LanguageInfo language)
      Notifies about finalization of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context was finalized
      Since:
      0.30
    • onLanguageContextDisposed

      void onLanguageContextDisposed(TruffleContext context, LanguageInfo language)
      Notifies about disposal of a language-specific context in an existing polyglot context.
      Parameters:
      context - the polyglot context
      language - the language for which a language-specific context was disposed
      Since:
      0.30
    • onContextClosed

      void onContextClosed(TruffleContext context)
      Notifies about close of a polyglot context.
      Since:
      0.30
    • onContextResetLimits

      default void onContextResetLimits(TruffleContext context)
      Invoked when the resource consumption limits were reset for a particular context. For example this is method each time the Context.resetLimits() method is called.
      Since:
      20.3