com.atlassian.jira.issue.fields.config.persistence
Class CachedFieldConfigSchemePersister
java.lang.Object
com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl
com.atlassian.jira.issue.fields.config.persistence.CachedFieldConfigSchemePersister
- All Implemented Interfaces:
- Startable, FieldConfigSchemePersister, JiraCachedManager
public class CachedFieldConfigSchemePersister
- extends FieldConfigSchemePersisterImpl
- implements JiraCachedManager, Startable
A simple caching wrapper
NOTE : you may be wondering about the cache invalidation strategy on this cache. Will the top level classes
that use this cache such as com.atlassian.jira.issue.CustomFieldManager@refreshCache
call init()
and this clears the cache.
TODO: This probably should be rewritten so that the upper lays of code are not responsible for clearing the lower level caches
and also the "cache inheritance" pattern should be removed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedFieldConfigSchemePersister
public CachedFieldConfigSchemePersister(OfBizDelegator delegator,
ConstantsManager constantsManager,
FieldConfigPersister fieldConfigPersister,
com.atlassian.event.api.EventPublisher eventPublisher,
FieldConfigContextPersister fieldContextPersister)
init
public void init()
- Specified by:
init
in interface FieldConfigSchemePersister
- Overrides:
init
in class FieldConfigSchemePersisterImpl
start
public void start()
throws Exception
- Description copied from interface:
Startable
- This method wil be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
- Specified by:
start
in interface Startable
- Throws:
Exception
- Allows implementations to throw an Exception.
onClearCache
@EventListener
public void onClearCache(ClearCacheEvent event)
getFieldConfigScheme
public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
- Specified by:
getFieldConfigScheme
in interface FieldConfigSchemePersister
- Overrides:
getFieldConfigScheme
in class FieldConfigSchemePersisterImpl
getConfigSchemesForCustomField
public List<FieldConfigScheme> getConfigSchemesForCustomField(ConfigurableField field)
- Specified by:
getConfigSchemesForCustomField
in interface FieldConfigSchemePersister
- Overrides:
getConfigSchemesForCustomField
in class FieldConfigSchemePersisterImpl
getConfigSchemeForFieldConfig
public FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
- Description copied from interface:
FieldConfigSchemePersister
- Finds the
FieldConfigScheme
that contains
the FieldConfig
- Specified by:
getConfigSchemeForFieldConfig
in interface FieldConfigSchemePersister
- Overrides:
getConfigSchemeForFieldConfig
in class FieldConfigSchemePersisterImpl
- Parameters:
fieldConfig
- the config to find the containing FieldConfigScheme
of; cannot be null.
- Returns:
- the first scheme that contains the
FieldConfig
. Not Null.
getCacheSize
public long getCacheSize()
- Specified by:
getCacheSize
in interface JiraCachedManager
remove
public void remove(Long fieldConfigSchemeId)
- Specified by:
remove
in interface FieldConfigSchemePersister
- Overrides:
remove
in class FieldConfigSchemePersisterImpl
refreshCache
public void refreshCache()
- Specified by:
refreshCache
in interface JiraCachedManager
Copyright © 2002-2012 Atlassian. All Rights Reserved.