|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.source.CachingConfigSource
public class CachingConfigSource
Instances of this class wrap other ConfigSource instances and cache the values they return. Instances of this class are not safe for concurrent use, even if the underlying ConfigSource is. Wrap instances in a SynchronousConfigSource if thread safety is required.
| Constructor Summary | |
|---|---|
CachingConfigSource(ConfigSource source,
long ttl)
Creates new a source which caches responses from another ConfigSource. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Return the cached properties field from the underlying ConfigSource. |
ConfigSource |
getSource()
Returns the ConfigSource which is being cached by this object. |
long |
getTTL()
The length time for which values may be cached without being refreshed. |
long |
lastModified()
Return the cached lastModified field from the underlying ConfigSource. |
void |
setTTL(long ttl)
Changes the length time for which values may be cached without being refreshed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachingConfigSource(ConfigSource source,
long ttl)
source - the configuration source to be cached, not nullttl - the length time for which values may be cached without being
refresed, not negative| Method Detail |
|---|
public void setTTL(long ttl)
ttl - changes the time-to-live value, not negativepublic long getTTL()
public ConfigSource getSource()
public long lastModified()
throws java.lang.RuntimeException
lastModified in interface ConfigSourcejava.lang.RuntimeException - if the field could not be read
public java.util.Map<java.lang.String,java.lang.String> getProperties()
throws java.lang.RuntimeException
getProperties in interface ConfigSourcejava.lang.RuntimeException - if the field could not be read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||