Class LockGuardedDrivenValue<T>
- java.lang.Object
- 
- com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValue<T>
 
- 
- Type Parameters:
- T- The type of the driven value
 - All Implemented Interfaces:
- DrivenValue<T>
 - Direct Known Subclasses:
- ExpressionDrivenValue,- LockGuardedDrivenValueCollection
 
 public abstract class LockGuardedDrivenValue<T> extends java.lang.Object implements DrivenValue<T> A LockGuardedDrivenValue is aDrivenValuewhich holds a lock object and asserts that Threads which callisReady(),isDirty(), andgetAndClear()hold this lock. Client code must synchronize on the lock before calling any of these methods.- See Also:
- Thread.holdsLock(Object)
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Objectlock
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedLockGuardedDrivenValue(java.lang.Object lock)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Optional<T>getAndClear()Fetch the current driven valueprotected abstract java.util.Optional<T>getAndClearInternal()Called after asserting that the calling thread holds the injected lock.booleanisDirty()protected abstract booleanisDirtyInternal()Called after asserting that the calling thread holds the injected lock.booleanisReady()protected abstract booleanisReadyInternal()Called after asserting that the calling thread holds the injected lock.java.util.Collection<PropertyReference>resolveReferences()Call before startup() to resolve and collect any references this value might depend on.protected abstract java.util.Collection<PropertyReference>resolveReferencesInternal()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.perspective.gateway.driven.DrivenValueshutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
isReadyInternalprotected abstract boolean isReadyInternal() Called after asserting that the calling thread holds the injected lock.- See Also:
- isReady()
 
 - 
isReadypublic boolean isReady() - Specified by:
- isReadyin interface- DrivenValue<T>
- Returns:
- true if the driven value is ready to fetch
 
 - 
isDirtyInternalprotected abstract boolean isDirtyInternal() Called after asserting that the calling thread holds the injected lock.- See Also:
- isDirty()
 
 - 
isDirtypublic boolean isDirty() - Specified by:
- isDirtyin interface- DrivenValue<T>
- Returns:
- true if the driven value has changed since the last time it was fetched
 
 - 
resolveReferencesInternalprotected abstract java.util.Collection<PropertyReference> resolveReferencesInternal() 
 - 
resolveReferencespublic java.util.Collection<PropertyReference> resolveReferences() Description copied from interface:DrivenValueCall before startup() to resolve and collect any references this value might depend on.- Specified by:
- resolveReferencesin interface- DrivenValue<T>
 
 - 
getAndClearInternal@Nonnull protected abstract java.util.Optional<T> getAndClearInternal() Called after asserting that the calling thread holds the injected lock.- See Also:
- getAndClear()
 
 - 
getAndClear@Nonnull public java.util.Optional<T> getAndClear() Description copied from interface:DrivenValueFetch the current driven value- Specified by:
- getAndClearin interface- DrivenValue<T>
- Returns:
- An Optionalcontaining the current driven value, if present, or an empty Optional if the driven value is null / not present.
 
 
- 
 
-