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.
      Parameters:
      object - the object to observe.
      Returns:
      true if the component is not disposing or disposed, false otherwise.
    • maybeObserve

      static boolean maybeObserve(@Nullable Object object)
      Invoke observe() on the supplied object if not null.
      Parameters:
      object - the object to observe if not null.
      Returns:
      true if the component is null or not disposing or disposed, false 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.