public class JiraSystemPropertiesCache extends Object implements PropertiesAccessor
JiraSystemProperties.
Cache misses are not cached (those returning null). Because of the implementation, cache misses raise
NullPointerExceptions which should be avoided.| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_CAPACITY
Capacity of cache
|
static long |
CACHE_WRITE_EXPIRY_SECONDS
Expiry time for the cache.
|
| Constructor and Description |
|---|
JiraSystemPropertiesCache(PropertiesAccessor accessor)
Constructor exposed currently for testing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Boolean |
getBoolean(String key) |
Integer |
getInteger(String key) |
Long |
getLong(String key) |
Properties |
getProperties()
Gets all system properties.
|
String |
getProperty(String key) |
protected com.google.common.cache.CacheBuilder<Object,Object> |
newBuilder()
Cache builder.
|
void |
refresh() |
void |
refresh(String key) |
void |
setProperties(Properties props) |
void |
setProperty(String key,
String value) |
void |
unsetProperty(String key) |
public static final long CACHE_WRITE_EXPIRY_SECONDS
public static final int CACHE_CAPACITY
public JiraSystemPropertiesCache(PropertiesAccessor accessor)
accessor - the proxy object to access properties store.protected com.google.common.cache.CacheBuilder<Object,Object> newBuilder()
public String getProperty(@Nonnull String key)
getProperty in interface PropertiesAccessorpublic void setProperty(@Nonnull String key, @Nonnull String value)
setProperty in interface PropertiesAccessorpublic Boolean getBoolean(@Nonnull String key)
getBoolean in interface PropertiesAccessorpublic Integer getInteger(@Nonnull String key)
getInteger in interface PropertiesAccessorpublic Long getLong(@Nonnull String key)
getLong in interface PropertiesAccessorpublic void refresh()
refresh in interface PropertiesAccessorpublic Properties getProperties()
getProperties in interface PropertiesAccessorpublic void setProperties(Properties props)
setProperties in interface PropertiesAccessorpublic void clear()
public void refresh(String key)
refresh in interface PropertiesAccessorpublic void unsetProperty(String key)
unsetProperty in interface PropertiesAccessorCopyright © 2002-2015 Atlassian. All Rights Reserved.