|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.core.Environment
public abstract class Environment
Describes the high-level runtime environment for the system. This includes such info as what operating system we're on, what kind of JVM is used, how it was launched, whether we must run in "read-only" mode, etc.
To access Environment, use the currentEnvironment() static method.
Like Thread.currentThread(), this will fetch the
appropriate one for your thread and runtime context.
It is possible that we may add "sandboxes" in the future, which have different Environments. For example, we may start the system from a web-launched app, then go into a more traditional file-based mode for another application. However, at present Environment is a de facto singleton.
Instances of Environment are immutable objects. Once created you cannot change them; feel free to pass around copies all you like. Environment is thread-safe.
Copyright 1997-2006 Partner Software, Inc.
| Field Summary | |
|---|---|
protected boolean |
headless
|
protected java.lang.String |
jreDescription
|
protected boolean |
modular
|
protected OS |
os
|
protected java.lang.String |
osDescription
|
protected java.lang.String |
partnerBuild
|
protected java.lang.String |
partnerCopyright
|
protected java.lang.String |
partnerRelease
|
protected boolean |
readOnly
|
protected java.lang.String |
userName
|
protected boolean |
webStarted
|
protected java.lang.String |
webStartURL
|
| Constructor Summary | |
|---|---|
protected |
Environment()
|
| Method Summary | |
|---|---|
static Environment |
currentEnvironment()
Returns the correct Environment for your thread and runtime context. |
java.lang.String |
getJREDescription()
|
OS |
getOS()
Returns the specific OS object for this environment. |
java.lang.String |
getOSDescription()
|
java.lang.String |
getPartnerBuild()
|
java.lang.String |
getPartnerCopyright()
|
java.lang.String |
getPartnerRelease()
|
java.lang.String |
getUserName()
|
java.lang.String |
getWebStartURL()
|
boolean |
isHeadless()
Returns true if the app is running in headless (daemon) mode. |
boolean |
isLinux()
Convenience method to test for Linuxness. |
boolean |
isMac()
Convenience method to test for Macness. |
boolean |
isModular()
Returns true if system is running in a modular context (with a modular class loader). |
boolean |
isReadOnly()
|
boolean |
isWebStarted()
Returns true if the app is running via Java WebStart. |
boolean |
isWindows()
Convenience method to test for Windosity. |
static void |
setDefaultEnvironment(Environment newDefault)
Sets the default Environment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected OS os
protected java.lang.String osDescription
protected java.lang.String jreDescription
protected java.lang.String userName
protected boolean headless
protected boolean readOnly
protected boolean webStarted
protected java.lang.String webStartURL
protected java.lang.String partnerRelease
protected java.lang.String partnerBuild
protected java.lang.String partnerCopyright
protected boolean modular
| Constructor Detail |
|---|
protected Environment()
| Method Detail |
|---|
public static Environment currentEnvironment()
public static void setDefaultEnvironment(Environment newDefault)
newDefault - new default Environment implementationpublic boolean isLinux()
public boolean isMac()
public boolean isWindows()
public OS getOS()
OS the app is running on.public boolean isHeadless()
public boolean isWebStarted()
public java.lang.String getWebStartURL()
public java.lang.String getOSDescription()
public java.lang.String getJREDescription()
public boolean isReadOnly()
public java.lang.String getUserName()
public java.lang.String getPartnerRelease()
public java.lang.String getPartnerBuild()
public java.lang.String getPartnerCopyright()
public boolean isModular()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||