|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.config.DefaultConfigPolicy
public class DefaultConfigPolicy
If no policy is explicitly specified for a config, an instance of this class is used by default.
| Field Summary | |
|---|---|
static long |
DEFAULT_MIN_READ_PERIOD
The value returned by the getMinReadPeriod() method. |
| Constructor Summary | |
|---|---|
DefaultConfigPolicy()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
defaultForClass(java.lang.Class clss)
Returns -1 for whole number primitives, 0.0 for floating point primitives, false for boolean primitives and \0 for character primitives. |
long |
getMinReadPeriod()
This default implementation returns the value of DEFAULT_MIN_READ_PERIOD. |
boolean |
isCachingEager()
By default, values from possibly different class loaders are cacheable. |
boolean |
isDefaultsCached()
By default, the default values generated by defaultForClass are cached. |
boolean |
isExceptionLogged()
By default exceptions are not logged because they are expected to be caught and logged by the client code. |
boolean |
isExceptionThrown()
By default exceptions are thrown. |
boolean |
isTimestampNewer(long newTimestamp,
long oldTimestamp)
The default implementation returns true if and only if the new timestamp is strictly greater than the old timestamp. |
java.lang.String |
propertyFromMethod(java.lang.String methodName)
The default implementation drops "get" and "is" prefixes and replaces progressions to upper case into hyphens eg. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFAULT_MIN_READ_PERIOD
| Constructor Detail |
|---|
public DefaultConfigPolicy()
| Method Detail |
|---|
public long getMinReadPeriod()
getMinReadPeriod in interface ConfigPolicy
public boolean isTimestampNewer(long newTimestamp,
long oldTimestamp)
isTimestampNewer in interface ConfigPolicynewTimestamp - the timestamp of a new set of propertiesoldTimestamp - the timestamp of the previous set of properties.
public boolean isExceptionThrown()
isExceptionThrown in interface ConfigPolicypublic boolean isExceptionLogged()
isExceptionLogged in interface ConfigPolicypublic java.lang.String propertyFromMethod(java.lang.String methodName)
propertyFromMethod in interface ConfigPolicymethodName - the name of a method which is to be satisfied
public java.lang.Object defaultForClass(java.lang.Class clss)
defaultForClass in interface ConfigPolicyclss - the type of value for which a primitive value is needed
public boolean isDefaultsCached()
isDefaultsCached in interface ConfigPolicypublic boolean isCachingEager()
isCachingEager in interface ConfigPolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||