Interface ComponentObservable

All Known Implementing Classes:
ComponentKernel

public interface ComponentObservable
Interface implemented by components so that observers can observe the component without observing a particular property.
  • Method Details

    • observe

      boolean observe()
      Return true if the component is "alive" a.k.a. not disposing or disposed. This method MUST be invoked within a non-DISPOSE transaction and will add the component as a dependency if the transaction is tracking, unless this component is disposing or disposed.
      Returns:
      true if the component is "alive" a.k.a. not disposing or disposed.
    • observe

      static boolean observe(@Nonnull Object object)
      Invoke observe() on the supplied object if any. If a null object is passed into this method then it will return true. If an object that is not an instance of ComponentObservable is passed into this method then it will return true.
      Parameters:
      object - the object to observe if any.
      Returns:
      false if the component is not disposing or disposed, true otherwise.
    • notObserved

      static boolean notObserved(@Nonnull Object object)
      Return true if observe(Object) returns false for the same parameter.
      Parameters:
      object - the object to observe if any.
      Returns:
      true if observe(Object) returns false for the same parameter, false otherwise.
    • asComponentObservable

      @Nonnull static ComponentObservable asComponentObservable(@Nonnull Object object)
      Cast specified object to an instance of ComponentObservable. Invariant checks will verify that the cast is valid before proceeding.
      Parameters:
      object - the object.
      Returns:
      the object cast to ComponentObservable.