|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.util.CachedDelayedResult
public abstract class CachedDelayedResult
An implementation of IDelayedResult
which caches the computed
result.
Field Summary | |
---|---|
protected java.lang.Object |
_cachedResult
The lazily computed and cached result. |
protected java.lang.Throwable |
_lastException
The exception thrown when _computeResult() was run. |
Constructor Summary | |
---|---|
CachedDelayedResult()
|
Method Summary | |
---|---|
protected abstract java.lang.Object |
_computeResult()
Compute the result. |
java.lang.Object |
force()
If the result has been cached, return it. |
boolean |
hasBeenForced()
Return true if the result has been computed already. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object _cachedResult
protected java.lang.Throwable _lastException
_computeResult()
was run.
Constructor Detail |
---|
public CachedDelayedResult()
Method Detail |
---|
public final java.lang.Object force()
RuntimeException
whose cause is that exception. Otherwise,
call _computeResult()
and save it in the cache. This
method is synchronized so it is thread-safe.
force
in interface IDelayedResult
public final boolean hasBeenForced()
protected abstract java.lang.Object _computeResult()
_lastException
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |