public class SystemState extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger
Handy logging object.
|
Modifier | Constructor and Description |
---|---|
private |
SystemState() |
Modifier and Type | Method and Description |
---|---|
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 <T> T |
hackyMethodCall(String methodName,
T defaultValue)
Attempt to invoke
OperatingSystemMXBean.methodName via
reflection. |
static Map<String,String> |
queryIdvBuildProperties() |
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() |
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 . |
private static final org.slf4j.Logger logger
private SystemState()
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()
public static Map<String,String> queryMcvBuildProperties()
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.