java.lang.Object | |
↳ | com.atlassian.jira.cache.LazyLoadingCache<D> |
This class allows us to set up a cache that is lazy-loaded in a thread-safe way.
The type D is the type of the cache Data. It should normally be an immutable data object.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LazyLoadingCache.CacheLoader<D> |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the cache data object.
| |||||||||||
This method will load the latest cache data, and then replace the existing cache data.
| |||||||||||
This method will throw away any existing cache data, and leave the LazyLoadingCache uninitialised.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object |
Gets the cache data object.
Calling this method may cause the cache data to be loaded, if it has not been loaded yet.
This method will load the latest cache data, and then replace the existing cache data.
Note that it leaves the old cache data intact while the load is occuring in order to allow readers to continue to work without blocking.
This method is synchronized in order to stop a possible race condition that could publish stale data.
This method will throw away any existing cache data, and leave the LazyLoadingCache uninitialised. This means that the cache will need to be loaded on the next call to getData(), and readers will be blocked until the cache is reloaded.