public class

JiraSystemPropertiesCache

extends Object
implements PropertiesAccessor
java.lang.Object
   ↳ com.atlassian.jira.config.properties.JiraSystemPropertiesCache

Class Overview

This class provides caching of system properties. This is internal implementation used by JiraSystemProperties.

Cache misses are not cached (those returning null). Because of the implementation, cache misses raise NullPointerExceptions which should be avoided.

Summary

Constants
int CACHE_CAPACITY Capacity of cache
long CACHE_WRITE_EXPIRY_SECONDS Expiry time for the cache.
Public Constructors
JiraSystemPropertiesCache(PropertiesAccessor accessor)
Constructor exposed currently for testing.
Public Methods
void clear()
Boolean getBoolean(String key)
Integer getInteger(String key)
Long getLong(String key)
Properties getProperties()
Gets all system properties.
String getProperty(String key)
void refresh()
void refresh(String key)
void setProperties(Properties props)
void setProperty(String key, String value)
void unsetProperty(String key)
Protected Methods
CacheBuilder<ObjectObject> newBuilder()
Cache builder.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.config.properties.PropertiesAccessor

Constants

public static final int CACHE_CAPACITY

Capacity of cache

Constant Value: 100 (0x00000064)

public static final long CACHE_WRITE_EXPIRY_SECONDS

Expiry time for the cache.

Constant Value: 60 (0x000000000000003c)

Public Constructors

public JiraSystemPropertiesCache (PropertiesAccessor accessor)

Constructor exposed currently for testing.

Parameters
accessor the proxy object to access properties store.

Public Methods

public void clear ()

public Boolean getBoolean (String key)

public Integer getInteger (String key)

public Long getLong (String key)

public Properties getProperties ()

Gets all system properties. Returns a snapshot of system properties obtain at the time of the call, which may be considered immediately invalid. This is not a live view of the system properties.

public String getProperty (String key)

public void refresh ()

public void refresh (String key)

public void setProperties (Properties props)

public void setProperty (String key, String value)

public void unsetProperty (String key)

Protected Methods

protected CacheBuilder<ObjectObject> newBuilder ()

Cache builder. Exposed to mock and test timed eviction.