|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.project.version.CachingVersionStore
public class CachingVersionStore
A caching implementation of the VersionStore that relies on a delegate to do the DB operations.
This class needs some thread synchronisation for thread safety, to avoid loading a stale copy of the Versions into the cache. However, it is optimised such that readers will never be blocked by writers, and writers only block each other for the minimum necessary time. Because pre-loading the cache would add overhead to JIRA's startup, the cache is lazily initialised, and so the first call will load the cache for the first time. This is the only time that readers may block, waiting for the cache to be initialised.
| Constructor Summary | |
|---|---|
CachingVersionStore(VersionStore delegate,
com.atlassian.event.api.EventPublisher eventPublisher)
|
|
| Method Summary | |
|---|---|
org.ofbiz.core.entity.GenericValue |
createVersion(Map versionParams)
|
void |
deleteVersion(org.ofbiz.core.entity.GenericValue versionGV)
|
List |
getAllVersions()
Returns a list of GenericValues representing all Versions in JIRA, ordered by sequence. |
org.ofbiz.core.entity.GenericValue |
getVersion(Long id)
|
void |
onClearCache(ClearCacheEvent event)
|
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
void |
storeVersion(Version version)
Stores an individual Version in the DB. |
void |
storeVersions(Collection<Version> versions)
Stores a collection of Version objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachingVersionStore(VersionStore delegate,
com.atlassian.event.api.EventPublisher eventPublisher)
| Method Detail |
|---|
public void start()
throws Exception
Startable
start in interface StartableException - Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public List getAllVersions()
VersionStore
getAllVersions in interface VersionStorepublic org.ofbiz.core.entity.GenericValue getVersion(Long id)
getVersion in interface VersionStorepublic org.ofbiz.core.entity.GenericValue createVersion(Map versionParams)
createVersion in interface VersionStorepublic void storeVersion(Version version)
VersionStoreVersionStore.storeVersions(java.util.Collection) , it can be more efficient.
storeVersion in interface VersionStoreversion - The Version to store.VersionStore.storeVersions(java.util.Collection) public void storeVersions(Collection<Version> versions)
VersionStorestoreVersion() multiple times.
eg the CachingVersionStore will reload the cache from DB with every call to storeVersion().
- Specified by:
storeVersions in interface VersionStore
- Parameters:
versions - Collection of Version objects.- See Also:
VersionStore.storeVersion(Version)
public void deleteVersion(org.ofbiz.core.entity.GenericValue versionGV)
deleteVersion in interface VersionStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||