@Service(value="blSystemPropertiesService") public class SystemPropertiesServiceImpl extends Object implements SystemPropertiesService
| Modifier and Type | Field and Description |
|---|---|
protected javax.cache.CacheManager |
cacheManager |
protected org.springframework.core.env.Environment |
env |
protected static String |
ENV_CACHE_PREFIX |
protected SystemPropertyServiceExtensionManager |
extensionManager |
protected static ThreadLocal<Boolean> |
originatedFromEnvironment
If the property resoltion comes from the Spring Environment I don't want to try to re-resolve a property from the Environment.
|
static String |
PROPERTY_SOURCE_NAME |
protected static String |
SYSTEM_PROPERTY_CACHE_NAME |
protected SystemPropertiesDao |
systemPropertiesDao |
protected javax.cache.Cache<String,String> |
systemPropertyCache |
protected int |
systemPropertyCacheTimeout |
| Constructor and Description |
|---|
SystemPropertiesServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPropertyToCache(String propertyName,
String propertyValue) |
protected String |
buildKey(String propertyName)
Properties can vary by site.
|
protected String |
buildKey(String propertyName,
Long siteId) |
protected String |
buildKey(String propertyName,
Long siteId,
boolean forceEnvPrefix) |
protected String |
buildKey(SystemProperty systemProperty)
Properties can vary by site.
|
protected String |
buildKey(SystemProperty systemProperty,
boolean forceEnvPrefix) |
SystemProperty |
findById(Long id)
Finds a SystemProperty by its internal id
|
protected String |
getCacheName() |
protected String |
getPropertyFromCache(String propertyName) |
protected javax.cache.Cache<String,String> |
getSystemPropertyCache() |
boolean |
isValueValidForType(String value,
SystemPropertyFieldType type)
Determines if the given value is valid for the specified type
|
void |
removeFromCache(SystemProperty systemProperty)
Evicts the given SystemProperty from the cache
|
boolean |
resolveBooleanSystemProperty(String name)
Resolves a boolean system property.
|
boolean |
resolveBooleanSystemProperty(String name,
boolean defaultValue) |
int |
resolveIntSystemProperty(String name)
Resolves an int system property.
|
int |
resolveIntSystemProperty(String name,
int defaultValue) |
long |
resolveLongSystemProperty(String name)
Resolves an long system property.
|
long |
resolveLongSystemProperty(String name,
long defaultValue) |
String |
resolveSystemProperty(String name)
Preferred method for looking up properties.
|
String |
resolveSystemProperty(String name,
String defaultValue) |
public static final String PROPERTY_SOURCE_NAME
protected static final String ENV_CACHE_PREFIX
protected static final String SYSTEM_PROPERTY_CACHE_NAME
protected static final ThreadLocal<Boolean> originatedFromEnvironment
protected SystemPropertiesDao systemPropertiesDao
protected SystemPropertyServiceExtensionManager extensionManager
@Value(value="${system.property.cache.timeout}")
protected int systemPropertyCacheTimeout
protected javax.cache.CacheManager cacheManager
@Autowired protected org.springframework.core.env.Environment env
public String resolveSystemProperty(String name, String defaultValue)
resolveSystemProperty in interface SystemPropertiesServicepublic String resolveSystemProperty(String name)
SystemPropertiesServiceresolveSystemProperty in interface SystemPropertiesServiceprotected String buildKey(String propertyName)
propertyName - protected String buildKey(SystemProperty systemProperty)
systemProperty - protected String buildKey(SystemProperty systemProperty, boolean forceEnvPrefix)
protected String getCacheName()
public SystemProperty findById(Long id)
SystemPropertiesServicefindById in interface SystemPropertiesServiceSystemPropertypublic void removeFromCache(SystemProperty systemProperty)
SystemPropertiesServiceremoveFromCache in interface SystemPropertiesServicepublic int resolveIntSystemProperty(String name)
SystemPropertiesServiceresolveIntSystemProperty in interface SystemPropertiesServicepublic int resolveIntSystemProperty(String name, int defaultValue)
resolveIntSystemProperty in interface SystemPropertiesServicepublic boolean resolveBooleanSystemProperty(String name)
SystemPropertiesServiceresolveBooleanSystemProperty in interface SystemPropertiesServicepublic boolean resolveBooleanSystemProperty(String name, boolean defaultValue)
resolveBooleanSystemProperty in interface SystemPropertiesServicepublic long resolveLongSystemProperty(String name)
SystemPropertiesServiceresolveLongSystemProperty in interface SystemPropertiesServicepublic long resolveLongSystemProperty(String name, long defaultValue)
resolveLongSystemProperty in interface SystemPropertiesServicepublic boolean isValueValidForType(String value, SystemPropertyFieldType type)
SystemPropertiesServiceisValueValidForType in interface SystemPropertiesServiceCopyright © 2022. All rights reserved.