public class JiraSystemPropertiesCache extends Object implements PropertiesAccessor
JiraSystemProperties
.
Cache misses are not cached (those returning null). Because of the implementation, cache misses raise
NullPointerException
s 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 PropertiesAccessor
public void setProperty(@Nonnull String key, @Nonnull String value)
setProperty
in interface PropertiesAccessor
public Boolean getBoolean(@Nonnull String key)
getBoolean
in interface PropertiesAccessor
public Integer getInteger(@Nonnull String key)
getInteger
in interface PropertiesAccessor
public Long getLong(@Nonnull String key)
getLong
in interface PropertiesAccessor
public void refresh()
refresh
in interface PropertiesAccessor
public Properties getProperties()
getProperties
in interface PropertiesAccessor
public void setProperties(Properties props)
setProperties
in interface PropertiesAccessor
public void clear()
public void refresh(String key)
refresh
in interface PropertiesAccessor
public void unsetProperty(String key)
unsetProperty
in interface PropertiesAccessor
Copyright © 2002-2015 Atlassian. All Rights Reserved.