Interface ConfigContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
TriggerSupport

public interface ConfigContext extends Serializable
Context passed into buildClientConfig so trigger/action/output subclasses can reference other outputs and elements by stable id without needing direct access to the host's TriggerSupport.

For internal use only.

  • Method Summary

    Modifier and Type
    Method
    Description
    The host element this snapshot belongs to.
    default int
    Returns a stable parameter index for the given component's root element.
    int
    Returns a stable parameter index for the given element.
    int
    Returns a stable id for the given output, registering it with the host's TriggerSupport if it hasn't been registered yet.
    void
    Schedules a fresh client snapshot for the host to be emitted on the next beforeClientResponse flush.
  • Method Details

    • registerOutput

      int registerOutput(Output<?> output)
      Returns a stable id for the given output, registering it with the host's TriggerSupport if it hasn't been registered yet.
      Parameters:
      output - the output to reference, not null
      Returns:
      the id of the output in the surrounding snapshot
    • referenceElement

      int referenceElement(Element element)
      Returns a stable parameter index for the given element. Host element is index 0 (this in the executeJs invocation); other elements get sequential indices starting at 1.
      Parameters:
      element - the element to reference, not null
      Returns:
      the parameter index
    • referenceElement

      default int referenceElement(Component component)
      Returns a stable parameter index for the given component's root element.
      Parameters:
      component - the component to reference, not null
      Returns:
      the parameter index
    • getHost

      Element getHost()
      The host element this snapshot belongs to. Useful for outputs that install element-scoped subscriptions (e.g. SignalOutput via ElementEffect.effect).
      Returns:
      the host element
    • scheduleSync

      void scheduleSync()
      Schedules a fresh client snapshot for the host to be emitted on the next beforeClientResponse flush. Used by outputs whose value may change between trigger fires (e.g. a SignalOutput). Idempotent within a request.