|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.wisc.ssec.mcidasv.util.SystemState
public class SystemState
Utility methods for querying the state of the user's machine.
| Field Summary | |
|---|---|
private static org.slf4j.Logger |
logger
Handy logging object. |
| Constructor Summary | |
|---|---|
private |
SystemState()
|
| Method Summary | ||
|---|---|---|
static String |
escapeWhitespaceChars(CharSequence sequence)
|
|
static Map<Integer,Rectangle> |
getDisplayBounds()
Returns a mapping of display number to a Rectangle
that represents the "bounds" of the display. |
|
static String |
getIdvVersionString()
Gets a human-friendly representation of the information embedded within IDV's build.properties. |
|
static String |
getMcvVersionString()
Gets a human-friendly representation of the information embedded within McIDAS-V's build.properties. |
|
private InputStream |
getResourceAsStream(String name)
|
|
static String |
getStateAsString(McIDASV mcv)
Builds a (filtered) subset of the McIDAS-V system properties and returns the results as a String. |
|
static String |
getStateAsString(McIDASV mcv,
boolean firehose)
Builds the McIDAS-V system properties and returns the results as a String. |
|
static Rectangle |
getVirtualDisplayBounds()
|
|
private static
|
hackyMethodCall(String methodName,
T defaultValue)
Attempt to invoke OperatingSystemMXBean.methodName via
reflection. |
|
static Map<String,String> |
queryIdvBuildProperties()
Returns a Map of the (currently) most useful contents of
ucar/unidata/idv/resources/build.properties. |
|
static Map<String,Object> |
queryJava3d()
Polls Java 3D for information about its environment. |
|
static Map<Object,Object> |
queryJythonProps()
Returns the contents of Jython's registry (basically just Jython-specific properties) as well as some of the information from Python's "sys" module. |
|
static Map<String,String> |
queryMachine()
Polls Java for information about the user's machine. |
|
static Map<String,String> |
queryMcvBuildProperties()
Returns a Map of the (currently) most useful contents of
edu/wisc/ssec/mcidasv/resources/build.properties. |
|
static Map<String,Object> |
queryMcvState(McIDASV mcv)
Queries McIDAS-V for information about its state. |
|
static Map<String,String> |
queryOpSysProps()
Attempts to call methods belonging to com.sun.management.OperatingSystemMXBean. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.slf4j.Logger logger
| Constructor Detail |
|---|
private SystemState()
| Method Detail |
|---|
public static String escapeWhitespaceChars(CharSequence sequence)
private static <T> T hackyMethodCall(String methodName,
T defaultValue)
OperatingSystemMXBean.methodName via
reflection.
T - Either Long or Double.methodName - The method to invoke. Must belong to
com.sun.management.OperatingSystemMXBean.defaultValue - Default value to return, must be in
"boxed" form.
methodName call or
defaultValue.public static Map<Object,Object> queryJythonProps()
public static Map<String,String> queryOpSysProps()
com.sun.management.OperatingSystemMXBean. If successful, we'll
have the following information:
public static Map<String,String> queryMachine()
Map of properties that describes the user's machine.public static Map<Integer,Rectangle> getDisplayBounds()
Rectangle
that represents the "bounds" of the display.
public static Rectangle getVirtualDisplayBounds()
public static Map<String,Object> queryJava3d()
VirtualUniverse.getProperties() and
Canvas3D.queryProperties().
public static String getIdvVersionString()
build.properties.
String that looks like "IDV version major.minor<b>revision</b> built <b>date</b>".
For example: IDV version 2.9u4 built 2011-04-13 14:01 UTC.public static String getMcvVersionString()
build.properties.
String that looks like "McIDAS-V version major.minor<b>release</b> built <b>date</b>".
For example: McIDAS-V version 1.02beta1 built 2011-04-14 17:36.private InputStream getResourceAsStream(String name)
public static Map<String,String> queryIdvBuildProperties()
Map of the (currently) most useful contents of
ucar/unidata/idv/resources/build.properties.
Consider the output of getIdvVersionString(); it's built
with the the following:
idv.version.major: currently "2"idv.version.minor: currently "9"idv.version.revision: currently "u4"}idv.build.date: varies pretty frequently,
as it's the build timestamp for idv.jar
Map of at least the useful parts of build.properties.public static Map<String,String> queryMcvBuildProperties()
Map of the (currently) most useful contents of
edu/wisc/ssec/mcidasv/resources/build.properties.
Consider the output of getMcvVersionString(); it's built
with the the following:
mcidasv.version.major:
currently "1"mcidasv.version.minor:
currently "02"mcidasv.version.release: currently
"beta1"mcidasv.build.date: varies pretty frequently, as
it's the build timestamp for mcidasv.jar.
Map of at least the useful parts of build.properties.public static Map<String,Object> queryMcvState(McIDASV mcv)
public static String getStateAsString(McIDASV mcv)
String.
KEY=VALUE\n. This is so we kinda-sorta conform to the standard
Properties file format.getStateAsString(edu.wisc.ssec.mcidasv.McIDASV, boolean)
public static String getStateAsString(McIDASV mcv,
boolean firehose)
String.
firehose - If true, enables "unfiltered" output.
KEY=VALUE\n. This is so we kinda-sorta conform to the standard
Properties file format.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||