Package arez

Class Observer

All Implemented Interfaces:
Disposable

public final class Observer extends Node
A node within Arez that is notified of changes in 0 or more Observables.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Make the Observer INACTIVE and release any resources associated with observer.
    boolean
    Return true if dispose() has been called on object.
    void
    This method should be invoked if the observer has non-arez dependencies and one of these dependencies has been updated.
    void
    Schedule this observer if it does not already have a reaction pending.

    Methods inherited from class arez.Node

    getContext, getName, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface arez.Disposable

    isNotDisposed
  • Method Details

    • dispose

      public void dispose()
      Make the Observer INACTIVE and release any resources associated with observer. The applications should NOT interact with the Observer after it has been disposed.
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Return true if dispose() has been called on object.
      Returns:
      true if dispose has been called.
    • reportStale

      public void reportStale()
      This method should be invoked if the observer has non-arez dependencies and one of these dependencies has been updated. This will mark the observer as stale and reschedule the reaction if necessary. The method must be invoked from within a read-write transaction. the reaction if necessary. The method must be invoked from within a read-write transaction.
    • schedule

      public void schedule()
      Schedule this observer if it does not already have a reaction pending. The observer will not actually react if it is not already marked as STALE.