public abstract class Config extends Object
Config
is a helper class for processing a Coherence configuration
system properties.
As of Coherence 12.2.1, all Coherence system properties start with coherence.
.
There is backwards compatibility support that if the property is not found,
then the property is looked up again with tansogol.
prepended and
lastly by replacing the coherence.
in the system property name to
support Coherence system property naming conventions prior to Coherence 12.2.1.
Note: These methods should only be used when the system property name may begin with "coherence.*" or "tangosol.*". The native method for looking up a system or environment property should be used to lookup up a OS/Language native property.
Constructor and Description |
---|
Config() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(String sName)
Returns true if coherence system property
sName exists and
value is equal to string true. |
static boolean |
getBoolean(String sName,
boolean fDefault)
Return true if property
sName exists and its value is string true. |
static Double |
getDouble(String sName)
Return Coherence system property value as a Double.
|
static Double |
getDouble(String sName,
double dDefault)
Return Coherence system property value as a double.
|
static com.oracle.coherence.common.util.Duration |
getDuration(String sName)
Return Coherence system property value as a
Duration . |
static com.oracle.coherence.common.util.Duration |
getDuration(String sName,
com.oracle.coherence.common.util.Duration dDefault)
Return Coherence system property value as a
Duration . |
static String |
getenv(String sName)
Coherence enhanced system environment getter
Use instead of
System.getenv(String) . |
static Float |
getFloat(String sName)
Return Coherence system property value as a Float.
|
static Float |
getFloat(String sName,
float fDefault)
Return Coherence system property value as a float.
|
static Integer |
getInteger(String sName)
Return Coherence system property value as an Integer.
|
static Integer |
getInteger(String sName,
int iDefault)
Return Coherence system property value as an Integer.
|
static Long |
getLong(String sName)
Return Coherence system property value as a Long.
|
static Long |
getLong(String sName,
long lDefault)
Return Coherence system property value as a long.
|
static String |
getProperty(String sName)
Get the value of Coherence property
sName
This implementation differs from System.getProperty(String) that a
SecurityException is handled and logged as a warning
and null is returned as the property's value. |
static String |
getProperty(String sName,
String sDefault)
Get a Coherence property value, return default if property lookup fails.
|
static String |
getProperty(String sName,
Supplier<String> supDefault)
Get a Coherence property value, returning the value provided by the supplier
if property lookup fails.
|
public static String getProperty(String sName)
sName
This implementation differs from System.getProperty(String)
that a
SecurityException
is handled and logged as a warning
and null is returned as the property's value.
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
sName
or null if property lookup
fails or property does not existpublic static String getProperty(String sName, String sDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
sDefault
- default value returned if property lookup failssName
, or sDefault
if
property lookup fails or no property definedpublic static String getProperty(String sName, Supplier<String> supDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
supDefault
- the supplier that provides a default value if property lookup failssName
, or value provided by the supDefault
if property lookup fails or no property definedpublic static boolean getBoolean(String sName)
sName
exists and
value is equal to string true.
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
true
if system property exists and equal to truepublic static boolean getBoolean(String sName, boolean fDefault)
sName
exists and its value is string true.
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
fDefault
- default value if property value lookup or conversion fails.sName
exists and its value is string true; otherwise,
return sDefault
.public static Integer getInteger(String sName)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
public static Integer getInteger(String sName, int iDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
iDefault
- integer default valueiDefault
public static Long getLong(String sName)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
public static Long getLong(String sName, long lDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
lDefault
- long default valuelDefault
public static Float getFloat(String sName)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
public static Float getFloat(String sName, float fDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
fDefault
- float default valuefDefault
public static Double getDouble(String sName)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
public static Double getDouble(String sName, double dDefault)
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
dDefault
- double default valuedDefault
public static com.oracle.coherence.common.util.Duration getDuration(String sName)
Duration
.
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
Duration
if property lookup and conversion
of the String value to Duration
succeeds;
otherwise, return nullpublic static com.oracle.coherence.common.util.Duration getDuration(String sName, com.oracle.coherence.common.util.Duration dDefault)
Duration
.
Backwards compatibility support is described in Config
.
sName
- Coherence system property name beginning with coherence.
dDefault
- default Duration
valueDuration
if property lookup and conversion
of the String value to Duration
succeeds; otherwise,
return dDefault
public static String getenv(String sName)
System.getenv(String)
.sName
- Coherence system environment property name