|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pelzer.util.EnvironmentManager
public class EnvironmentManager
Very simple wrapper class that pulls a few of the PropertyManager methods out
into a more logical location, for instance getBuildNumber() or
getHostname(), but ultimately delegates the work back to the
PropertyManager. The setDefaultEnvironment(String) method is
slightly smarter, as it sets a system property to override the default
environment, and then calls
PropertyManager.setDefaultEnvironment(String). This will result in a
very clean initialization of a static main method class into a particular
environment, if the following conditions are met:
setDefaultEnvironment(String) first, before any
pelzer-util method have been called (ie before any pelzer-util static
initialization has happened)
| Constructor Summary | |
|---|---|
EnvironmentManager()
|
|
| Method Summary | |
|---|---|
static String |
getBuildNumber()
Pulls 'build.number' from PropertyManager.version.properties. |
static String |
getEnvironment()
|
static String |
getHostname()
The first part of the hostname of this box, so for 'foo.bar.com', would return 'foo'. |
static boolean |
isInitialized()
|
static void |
setDefaultEnvironment(String environment)
Overrides and resets the PropertyManager to a new environment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnvironmentManager()
| Method Detail |
|---|
public static boolean isInitialized()
public static void setDefaultEnvironment(String environment)
public static String getEnvironment()
PropertyManager is
running against.public static String getBuildNumber()
public static String getHostname()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||