Class RecomputableSupport
java.lang.Object
org.apache.tapestry5.internal.util.RecomputableSupport
A utility class for managing a cacheable result that can be recomputed when needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Invokable<T>Wraps a computation with caching logic; once computed, the Invokable will return the same value, untilinvalidate()is invoked.voidForcesinvalidate()to be invoked when the hub emits an invalidation callback.voidInvalidates any existingcreate(org.apache.tapestry5.ioc.Invokable)wrappers} such that they will re-perform the computation when next invoked.
-
Constructor Details
-
RecomputableSupport
public RecomputableSupport()
-
-
Method Details
-
invalidate
Invalidates any existingcreate(org.apache.tapestry5.ioc.Invokable)wrappers} such that they will re-perform the computation when next invoked. -
initialize
Forcesinvalidate()to be invoked when the hub emits an invalidation callback.- Parameters:
hub-
-
create
Wraps a computation with caching logic; once computed, the Invokable will return the same value, untilinvalidate()is invoked.- Type Parameters:
T- type of result- Parameters:
invokable- a computation to perform, whose results are cacheable until invalidated- Returns:
- caching-enabled wrapper around invokable
-