public class RecomputableSupport extends Object
Constructor and Description |
---|
RecomputableSupport() |
Modifier and Type | Method and Description |
---|---|
<T> Invokable<T> |
create(Invokable<T> invokable)
Wraps a computation with caching logic; once computed, the Invokable will return the same value, until
invalidate() is invoked. |
void |
initialize(InvalidationEventHub hub)
Forces
invalidate() to be invoked when the hub emits an invalidation callback. |
void |
invalidate()
Invalidates any existing
create(org.apache.tapestry5.ioc.Invokable) wrappers} such that they will
re-perform the computation when next invoked. |
public RecomputableSupport()
public void invalidate()
create(org.apache.tapestry5.ioc.Invokable)
wrappers} such that they will
re-perform the computation when next invoked.public void initialize(InvalidationEventHub hub)
invalidate()
to be invoked when the hub emits an invalidation callback.hub
- public <T> Invokable<T> create(Invokable<T> invokable)
invalidate()
is invoked.T
- type of resultinvokable
- a computation to perform, whose results are cacheable until invalidated5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.