Package arez.component
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 Summary
Modifier and TypeMethodDescriptionstatic ComponentObservable
asComponentObservable
(Object object) Cast specified object to an instance of ComponentObservable.static boolean
notObserved
(Object object) Return true ifobserve(Object)
returns false for the same parameter.boolean
observe()
Return true if the component is "alive" a.k.a.static boolean
Invokeobserve()
on the supplied object if any.
-
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
Invokeobserve()
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 ofComponentObservable
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
Return true ifobserve(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
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.
-