public final class Config extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Config.PerformanceTuning
Enumerates performance tuning
|
static class |
Config.State
Enumerates the various config states
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_ENVENTITY_FULLNAME
Full name of the repositorie's simple entity containing environment properties
|
| Constructor and Description |
|---|
Config() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allowDuplicateEnvironmentInitialization(boolean val)
Sets whether duplicate initialization is permissible
|
static boolean |
checked()
Get whether system is globally configured to run in checked mode
|
static boolean |
compatibleWith3x()
Gets whether configuration settings should be compatible with X Platform 3.x
|
static boolean |
conserveCPU()
Gets whether or not an attempt will be made to conserve CPU (nv.conservecpu=true is set).
|
static boolean |
conserveMemory()
Gets whether or not an attempt will be made to conserve memory (nv.conservememory=true is set).
|
static boolean |
disableDisruptorWaitStrategyOptimizations()
Gets whether or not to disable disruptor wait strategy optimizations
|
static String |
getBinDirectory()
Get the runtime bin directory
|
static String |
getConfigDirectory()
Get the runtime configuration directory.
|
static String |
getDataDirectory()
Get the runtime data directory and create if absent.
|
static String |
getDataDirectory(boolean createIfAbsent)
Get the runtime data directory.
|
static String |
getJavaLibDirectory()
Get the java libs directory
|
static String |
getLogsDirectory()
Get the runtime trace log directory and create if absent.
|
static String |
getLogsDirectory(boolean createIfAbsent)
Get the runtime trace log directory.
|
static String |
getPlatform()
Get the runtime platform.
|
static Properties |
getPropertiesCopy()
Get a copy of the current environment property table
|
static Properties |
getPropertiesTo(Properties props)
Copy the current environment property table to a supplied property table
|
static Set<String> |
getPropertyNames()
Get the set of environment property names
This method returns a copy of the set of property names currently in
the configuration's environment
|
static IConfigRepository |
getRepository()
Get the configuration repository
This method returns the underlying configuration repository.
|
static String |
getRootDirectory()
Get the runtime root directory.
|
static Config.State |
getState()
Get the config state
|
static Tracer.Level |
getTraceLevel(String prop)
Convenience method to get a tracer's level from the config environment
|
static Tracer.Level |
getTraceLevel(String prop,
Tracer.Level defaultLevel)
Get a tracer's level from the config environment
|
static String |
getUnmanagedJavaLibDirectory()
Get the java unmanaged lib directory
|
static String |
getValue(String name)
Get a String property value from the config environment.
|
static boolean |
getValue(String name,
boolean defValue)
Get a boolean property value from config environment.
|
static byte |
getValue(String name,
byte defValue)
Get a byte property value from the config environment.
|
static double |
getValue(String name,
double defValue)
Get a double property value from the config environment.
|
static float |
getValue(String name,
float defValue)
Get a float property value from the config environment.
|
static int |
getValue(String name,
int defValue)
Get an int property value from the config environment.
|
static long |
getValue(String name,
long defValue)
Get an long property value from the config environment.
|
static short |
getValue(String name,
short defValue)
Get a short property value from the config environment.
|
static String |
getValue(String name,
String defValue)
Get a String property value from the config environment.
|
static boolean |
hasValue(String name)
Check if the config environment has a property
|
static void |
initializeEnvironment()
Initialize the configuration environment
This method invokes
initializeEnviroment(null)
|
static Set<String> |
initializeEnvironment(Properties props)
Initialize the configuration environment
|
static boolean |
isWindowsPlatform()
Get whether the an Rumi's runtime is installed on windows.
|
static boolean |
optimizeForLatency()
Deprecated.
Use tuneForLatency() instead
|
static boolean |
optimizeForThroughput()
Deprecated.
Use tuneForThroughput() instead
|
static boolean |
optimizeMemoryUsage()
Deprecated.
Use conserveMemory() instead
|
static void |
reset(Properties systemProperties)
Reset configuration repository and environment
|
static void |
resetEnvironment()
Reset the configuration environment.
|
static void |
resetRepository()
Reset the configuration repository
This method resets the underlying configuration repository.
|
static void |
setTraceLevel(Tracer tracer,
String prop)
Convenience method to set a tracer's level from the config environment
|
static void |
setTraceLevel(Tracer tracer,
String prop,
Tracer.Level defaultLevel)
Convenience method to set a tracer's level from the config environment
|
static boolean |
tuneForLatency()
Get whether system is globally configured to tune for latency
|
static boolean |
tuneForThroughput()
Get whether system is globally configured to tune for throughput
|
public static final String CONFIG_ENVENTITY_FULLNAME
public static final void allowDuplicateEnvironmentInitialization(boolean val)
public static final Set<String> initializeEnvironment(Properties props)
props - Set of properties that override all other sources for the environmentpublic static final void initializeEnvironment()
This method invokes initializeEnviroment(null)
public static final Config.State getState()
public static final Tracer.Level getTraceLevel(String prop, Tracer.Level defaultLevel)
public static final Tracer.Level getTraceLevel(String prop)
public static final void setTraceLevel(Tracer tracer, String prop, Tracer.Level defaultLevel)
public static final void setTraceLevel(Tracer tracer, String prop)
public static final Set<String> getPropertyNames()
This method returns a copy of the set of property names currently in the configuration's environment
public static final Properties getPropertiesTo(Properties props)
public static final Properties getPropertiesCopy()
public static final boolean hasValue(String name)
name - The property nameIllegalArgumentException - Thrown if supplied name is nullpublic static final byte getValue(String name, byte defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final short getValue(String name, short defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final int getValue(String name, int defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final long getValue(String name, long defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final float getValue(String name, float defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final double getValue(String name, double defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final boolean getValue(String name, boolean defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.IllegalArgumentException - Thrown if supplied name is nullpublic static final String getValue(String name)
name - The property nameStringIllegalArgumentException - Thrown if supplied name is nullpublic static final String getValue(String name, String defValue)
name - The property namedefValue - The default property value to return in case the property
is not present in the environment.StringIllegalArgumentException - Thrown if supplied name is nullpublic static final String getPlatform()
This method returns the runtime platform. The runtime platform is stored in the NVPLATFORM system property. A null value is returned in case the platform is not set.
public static final boolean isWindowsPlatform()
public static final String getRootDirectory()
This method returns the runtime root directory. The runtime root directory is stored in the NVROOT environment property. In case the property is not set, the current directory ('.') is returned as the runtime root.
public static final String getBinDirectory()
public static final String getConfigDirectory()
public static final String getJavaLibDirectory()
public static final String getUnmanagedJavaLibDirectory()
public static final String getDataDirectory(boolean createIfAbsent)
createIfAbsent - Causes the directory to be created if absent,public static final String getDataDirectory()
This method is equivalent to the invoking getDataDirectory(true)
public static final String getLogsDirectory(boolean createIfAbsent)
createIfAbsent - Causes the directory to be created if absent.public static final String getLogsDirectory()
This method is equivalent to the invoking getLogsDirectory(true)
public static final boolean checked()
public static final boolean tuneForLatency()
public static final boolean optimizeForLatency()
public static final boolean tuneForThroughput()
public static final boolean optimizeForThroughput()
@Deprecated public static final boolean optimizeMemoryUsage()
public static final boolean conserveMemory()
When set this instructs the runtime to try to conserve memory
public static final boolean conserveCPU()
When set this instructs the runtime to try to conserve CPU resources by avoiding spinning.
public static final boolean disableDisruptorWaitStrategyOptimizations()
public static final boolean compatibleWith3x()
public static final IConfigRepository getRepository()
This method returns the underlying configuration repository. Subsequent
invocations of this method will return the same instance of the repository
until resetRepository() is called after which the first invocation
of this method will reinitialize the underlying repository.
public static final void resetEnvironment()
This method resets the configuration environment to its pre-initialized state.
This method IS NOT intended for use in production environments. It serves primarily as a mechanism for clearing out the configuration environment in unit testing scenarios. This method IS NOT recommend to be used by end users and may be removed or altered without notice
public static final void resetRepository()
This method resets the underlying configuration repository. This will
cause a subsequent invocation of getRepository() to reinitialize
the underlying repository.
public static final void reset(Properties systemProperties)
systemProperties - If not null, the method will replace the system properties
with these supplied properties.
This method resets the configuration environment and repository and, optionally, resets the system properties to a supplied set of properties.
Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.