|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.ci.XRuntime
public class XRuntime
Provider runtime information of an X Platform installation.
Nested Class Summary | |
---|---|
static class |
XRuntime.Optimization
Enumerates global optimizations |
Field Summary | |
---|---|
static String |
defaultAppGroup
The default application group. |
static String |
defaultAppName
The default application name. |
Constructor Summary | |
---|---|
XRuntime()
|
Method Summary | |
---|---|
static boolean |
conserveCPU()
Gets whether or not an attempt will be made to conserve CPU (nv.conservecpu=true is set). |
static com.lmax.disruptor.WaitStrategy |
createWaitStrategy(String configuredWaitStrategy,
boolean optimize)
Constructs a Disruptor WaitStrategy . |
static String |
getAppGroup()
Get the Neeve application group. |
static String |
getAppName()
Get the Neeve application name. |
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 |
getFullAppName()
Get the fully qualifies Neeve application name. |
static String |
getJavaLibDirectory()
Get the java libs directory |
static com.neeve.license.License |
getLicense()
Gets the validated license for the X Runtime. |
static String |
getLicenseDirectory()
Get the runtime license directory |
static String |
getLocalHostAddress()
Alias for UtlEnv.getLocalHostAddress() |
static String |
getLocalHostAddressForDisplay(String defaultValue)
Alias for UtlEnv.getLocalHostAddressForDisplay(String) |
static String |
getLocalHostName()
Alias for UtlEnv.getLocalHostName() |
static String |
getLocalHostNameForDisplay(String defaultValue)
Alias for UtlEnv.getLocalHostNameForDisplay(String) |
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 |
getPid()
Get the process pid This method returns the process id of the current process |
static String |
getPlatform()
Get the runtime platform. |
static Properties |
getProps()
Get the Neeve runtime property set. |
static String |
getRootDirectory()
Get the runtime root directory. |
static String |
getUnmanagedJavaLibDirectory()
Get the java unmanaged lib directory |
static Object |
getValue(String name)
Get the value of a property from the environment props. |
static boolean |
getValue(String name,
boolean defValue)
Convenience method to return an environment property value as a boolean value |
static byte |
getValue(String name,
byte defValue)
Convenience method to return a property from the environment as a byte value. |
static double |
getValue(String name,
double defValue)
Convenience method to return a property from the environment as a double value. |
static float |
getValue(String name,
float defValue)
Convenience method to return a property from the environment as a float value. |
static int |
getValue(String name,
int defValue)
Convenience method to return a property from the environment as a int value. |
static long |
getValue(String name,
long defValue)
Convenience method to return a property from the environment as a int value. |
static short |
getValue(String name,
short defValue)
Convenience method to return a property from the environment as a float value. |
static String |
getValue(String name,
String defValue)
Convenience method to return a property value as a String value * |
static boolean |
isWindowsPlatform()
Get whether the an X Platform's runtime is installed on windows. |
static boolean |
optimizeForLatency()
Get whether system is globally configured to optimize for latency (nv.optimizefor=latency is set). |
static boolean |
optimizeForThroughput()
Get whether system is globally configured to optimize for throughput (nv.optimizefor=throughput is set). |
static boolean |
optimizeMemoryUsage()
Gets whether or not memory usage optimizations should be enabled. |
static void |
setAppGroup(String val)
Set the Neeve application group. |
static void |
setAppName(String val)
Set the Neeve application name. |
static void |
setOptimization(XRuntime.Optimization val)
Set the global optimization to use |
static void |
updateProps(Properties val)
Update the Neeve runtime property set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String defaultAppName
The value in this constant is returned by getAppName()
in case
the user has not specified the application name via the nv.app.name
runtime property or the setAppName(java.lang.String)
method.
public static final String defaultAppGroup
The value in this constant is returned by getAppGroup()
in case
the user has not specified the application name via the nv.app.group
runtime property or the setAppGroup(java.lang.String)
method.
Constructor Detail |
---|
public XRuntime()
Method Detail |
---|
public static com.neeve.license.License getLicense()
public static final void setOptimization(XRuntime.Optimization val)
public static final String getRootDirectory()
This method returns the runtime root directory. The runtime root directory is stored in the NVROOT system 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 getLicenseDirectory()
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 String getLocalHostNameForDisplay(String defaultValue)
UtlEnv.getLocalHostNameForDisplay(String)
public static final String getLocalHostName() throws UnknownHostException
UtlEnv.getLocalHostName()
UnknownHostException
public static final String getLocalHostAddressForDisplay(String defaultValue)
UtlEnv.getLocalHostAddressForDisplay(String)
public static final String getLocalHostAddress() throws UnknownHostException
UtlEnv.getLocalHostAddress()
UnknownHostException
public static final String getPid()
This method returns the process id of the current process
public static final void setAppGroup(String val)
val
- The group name to be set.
This method sets the Neeve application group. A Neeve application group partitions out participating Neeve applications into non-intersecting groups. Applications in different groups cannot communicate with each other.
public static final String getAppGroup()
This method returns the Neeve application group. The application group
is initialized on startup from the nv.app.group application
property and can be overriden via the setAppGroup(java.lang.String)
method. The
default value for the application name is defaultAppGroup
.
setAppGroup(java.lang.String)
public static final void setAppName(String val)
This method sets the Neeve application name. A Neeve application is a set of user classes managed by the same classloader that utilize the Neeve runtime to perform their function. The application name is a human readable name primarily for tracing and debugging purposes used to identify such a set of classes.
val
- The name to be set.public static final String getAppName()
This method returns the Neeve application name. The application name
is initialized on startup from the nv.app.name application
property and can be overriden via the setAppName(java.lang.String)
method. The
default value for the application name is defaultAppName
.
setAppName(java.lang.String)
public static final String getFullAppName()
This method concatenates the application name and group to produce the fully qualified application name. The format of the fully qualified name is [group]:[name]
getAppName()
,
getAppGroup()
public static final void updateProps(Properties val)
Several Neeve components support initialization and configuration using properties in the runtime property set. The application property set is maintained by this class. Upon startup, it is initialized with the Java runtime system property set and updated with properties specified in the property file referenced by the system property 'nv.app.propfile' if present. This method allows the user to further update the property set in case the user wishes to override the property values set using the above described manner.
This method will cause the Neeve application name to be reloaded using the 'nv.app.name' property in the new property set. The application name remains unchanged in case the property is absent from the new property set.
val
- The properties to update the property set with.public static final Properties getProps()
This method gets the Neeve runtime property set.
updateProps(java.util.Properties)
public static Object getValue(String name)
name
- The property name
public static boolean getValue(String name, boolean defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static double getValue(String name, double defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static float getValue(String name, float defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static long getValue(String name, long defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static int getValue(String name, int defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static short getValue(String name, short defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static byte getValue(String name, byte defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
public static String getValue(String name, String defValue)
name
- The property namedefValue
- The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
string value. It uses getValue(java.lang.String)
to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public 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 com.lmax.disruptor.WaitStrategy createWaitStrategy(String configuredWaitStrategy, boolean optimize) throws IllegalArgumentException
WaitStrategy
.
This call allows the platform to optimize disruptor wait strategy create based on the XRuntime.Optimization
currently set for the runtime by 'nv.optimizefor' when the passed in value for optimize is true:
BlockingWaitStrategy
to avoid spinning cores. This can be useful for test environments such as a user's workstation where spinning
cores may be costly.
true
:
optimizeForLatency()
is true a BusySpinWaitStrategy
is returned.
optimizeForThroughput()
is true a YieldingWaitStrategy
is returned.
configuredWaitStrategy
- The configured wait strategy which will be returned if the wait strategy isn't optimized.
Must be one of Blocking, Sleeping, Yielding or BusySpin.optimize
- If true
will optimize the configured wait strategy according to the 'nv.optimizefor'
environment variable unless nv.disablewaitstrategyoptimizations=true has been set in which case such optimizations are disabled.
WaitStrategy
for the given configuredWaitStrategy.
IllegalArgumentException
- if the configuredWaitStrategy is not one of Blocking, Sleeping, Yielding or BusySpin.public static final boolean optimizeForLatency()
public static final boolean optimizeForThroughput()
public static final boolean optimizeMemoryUsage()
public static final boolean conserveCPU()
When set this instructs the runtime to try to conserve CPU resources by avoiding spinning.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |