Author: mturk Date: Sat Apr 18 15:31:29 2009 New Revision: 766341 URL: http://svn.apache.org/viewvc?rev=766341&view=rev Log: Feature update
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Properties.java Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Properties.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Properties.java?rev=766341&r1=766340&r2=766341&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Properties.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Properties.java Sat Apr 18 15:31:29 2009 @@ -79,7 +79,7 @@ return get(key, null); } - private static int getInt(String key, int def) + private static int getI(String key, int def) { int rv = def; if (instance == null) @@ -96,12 +96,17 @@ return rv; } - private static int getInt(String key) + private static int getI(String key) { return getInt(key, 0); } - private static long getLong(String key, long def) + private static String getS(String key) + { + return get(key, "(error)"); + } + + private static long getL(String key, long def) { long rv = def; if (instance == null) @@ -118,29 +123,35 @@ return rv; } - private static long getLong(String key) + private static long getL(String key) { - return getLong(key, 0L); + return getL(key, 0L); } + // + // Cpu info section. + // /** Interval in milliseconds for a Cpu data caching. */ public static long CPU_CACHE_TTL; /** Minimum interval of Cpu data cache. */ - public static final long CPU_CACHE_TTL_MIN = getLong("cpu.cache.ttl.min", 1L); + public static final long CPU_CACHE_TTL_MIN = getL("cpu.cache.ttl.min", 1L); + + // + // Version info section. + // /** Major version of the runtime library */ - public static final int VERSION_MAJOR = getInt("runtime.version.major"); + public static final int VERSION_MAJOR = getI("runtime.version.major"); /** Minor version of the runtime library */ - public static final int VERSION_MINOR = getInt("runtime.version.minor"); + public static final int VERSION_MINOR = getI("runtime.version.minor"); /** Patch version of the runtime library */ - public static final int VERSION_PATCH = getInt("runtime.version.patch"); - - /** Patch version of the runtime library + public static final int VERSION_PATCH = getI("runtime.version.patch"); + /** Product name of the runtime library */ - public static final String VERSION_PNAME = get("runtime.version.pname"); + public static final String VERSION_PNAME = getS("runtime.version.pname"); }