|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.admin.cli.Environment
public final class Environment
The environment variables for CLI commands. An instance of this class is passed to each command to give it access to environment variables. Command implementations should access environment information from this class rather than using System.getenv. In multimode, the export command may change environment variables in the instance of this class that is shared by all commands.
| Field Summary | |
|---|---|
static String |
PREFIX
|
| Constructor Summary | |
|---|---|
Environment()
Initialize the enviroment with all relevant system environment entries. |
|
Environment(boolean ignoreEnvironment)
Constructor that ignores the system environment, mostly used to enable repeatable tests. |
|
| Method Summary | |
|---|---|
boolean |
debug()
|
Set<Map.Entry<String,String>> |
entrySet()
Return a set of all the entries, just like a Map does. |
String |
get(String name)
Get the named environment entry. |
boolean |
getBooleanOption(String name)
Return the value of the environment entry corresponding to the named option. |
File |
getDebugLogfile()
|
static String |
getDebugVar()
Get the name of the environment variable used to set debugging on |
String |
getStringOption(String name)
Return the value of the environment entry corresponding to the named option. |
boolean |
hasOption(String name)
Is there an environment entry corresponding to the named option? |
String |
put(String name,
String value)
Set the named environment entry to the specified value. |
String |
putOption(String name,
String value)
Set the environment entry corresponding to the named option to the specified value. |
void |
remove(String name)
Remove the name environment entry. |
static void |
setPrefix(String p)
Set the prefix for environment variables referenced from the system environment by Environment objects. |
static void |
setShortPrefix(String p)
Set the short prefix for environment variables referenced from the system enviornment by Environment objects. |
boolean |
trace()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String PREFIX
| Constructor Detail |
|---|
public Environment()
public Environment(boolean ignoreEnvironment)
| Method Detail |
|---|
public static void setPrefix(String p)
p - the new prefixpublic static void setShortPrefix(String p)
public static String getDebugVar()
public boolean getBooleanOption(String name)
name - the option name
public String getStringOption(String name)
name - the option name
public boolean hasOption(String name)
name - the option name
public String get(String name)
name - the name of the environment entry
public String put(String name,
String value)
name - the environment entry namevalue - the value
public void remove(String name)
name - the environment entry name
public String putOption(String name,
String value)
name - the option namevalue - the value
public Set<Map.Entry<String,String>> entrySet()
public boolean debug()
public boolean trace()
public File getDebugLogfile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||