Class AbstractResourceView

java.lang.Object
uno.anahata.asi.agi.resource.view.AbstractResourceView
All Implemented Interfaces:
ResourceView
Direct Known Subclasses:
MediaView, TextView

public abstract class AbstractResourceView extends Object implements ResourceView
Base implementation for resource views providing parent resource management.

This class manages the link back to the parent Resource, allowing views to trigger reactive reloads when their internal configuration changes.

  • Field Details

    • tokenCount

      protected transient Integer tokenCount
      The cached token count of this view's content under the active model. This is marked transient to prevent serializing stale counts across session restarts.
    • owner

      protected Resource owner
      The parent resource orchestrator. Circularity is handled natively by Kryo.
  • Constructor Details

    • AbstractResourceView

      public AbstractResourceView()
  • Method Details

    • resetTokenCount

      public void resetTokenCount()
      Resets the cached token count of this view, forcing a lazy recalculation on the next query.

      Clears the cached token count, forcing a lazy, background recalculation on the next query.

      Specified by:
      resetTokenCount in interface ResourceView
    • markDirty

      public void markDirty()
      Triggers a markDirty on the owner resource to signal that the view's settings have changed and need re-interpretation, and clears the cached token count.