|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.environment.params.simple.SimpleParameters
public class SimpleParameters
This class represents a generic Java process launching program which reads in preferences from a preferences file and then invokes another JVM using those prefs. If the launched JVM dies, this process can be configured to restart the JVM any number of times before giving up. This process can also be configured to launch the second JVM with a specified memory allocation, etc...
Nested Class Summary | |
---|---|
protected class |
SimpleParameters.MyProperties
|
Field Summary | |
---|---|
static java.lang.String |
ARRAY_SPACER
|
static java.lang.String |
defaultParamsFile
|
static java.lang.String |
FILENAME_EXTENSION
|
Constructor Summary | |
---|---|
SimpleParameters(java.lang.String[] orderedDefaults,
java.lang.String mutableConfigFileName)
|
Method Summary | |
---|---|
void |
addChangeListener(ParameterChangeListener p)
|
boolean |
contains(java.lang.String name)
See if the parameters contains the key |
java.util.Enumeration |
enumerateDefaults()
|
java.util.Enumeration |
enumerateNonDefaults()
|
boolean |
getBoolean(java.lang.String name)
|
double |
getDouble(java.lang.String name)
|
float |
getFloat(java.lang.String name)
|
java.net.InetAddress |
getInetAddress(java.lang.String name)
String format is dnsname ex: "computer.school.edu" |
java.net.InetSocketAddress |
getInetSocketAddress(java.lang.String name)
String format is name:port ex: "computer.school.edu:1984" |
java.net.InetSocketAddress[] |
getInetSocketAddressArray(java.lang.String name)
String format is comma seperated. |
int |
getInt(java.lang.String name)
|
long |
getLong(java.lang.String name)
|
protected java.lang.String |
getProperty(java.lang.String name)
|
java.lang.String |
getString(java.lang.String name)
|
java.lang.String[] |
getStringArray(java.lang.String name)
|
protected java.net.InetSocketAddress |
parseInetSocketAddress(java.lang.String name)
|
void |
remove(java.lang.String name)
Remove the key |
void |
removeChangeListener(ParameterChangeListener p)
|
void |
setBoolean(java.lang.String name,
boolean value)
|
void |
setDouble(java.lang.String name,
double value)
|
void |
setFloat(java.lang.String name,
float value)
|
void |
setInetAddress(java.lang.String name,
java.net.InetAddress value)
|
void |
setInetSocketAddress(java.lang.String name,
java.net.InetSocketAddress value)
|
void |
setInetSocketAddressArray(java.lang.String name,
java.net.InetSocketAddress[] value)
|
void |
setInt(java.lang.String name,
int value)
|
void |
setLong(java.lang.String name,
long value)
|
protected void |
setProperty(java.lang.String name,
java.lang.String value)
Note, this method does not implicitly call store() |
void |
setString(java.lang.String name,
java.lang.String value)
|
void |
setStringArray(java.lang.String name,
java.lang.String[] value)
|
void |
store()
Persistently stores the parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILENAME_EXTENSION
public static final java.lang.String ARRAY_SPACER
public static final java.lang.String defaultParamsFile
Constructor Detail |
---|
public SimpleParameters(java.lang.String[] orderedDefaults, java.lang.String mutableConfigFileName)
orderedDefaults
- mutableConfigFileName
- if this is null, no params are saved, if this file doesn't exist,
you will get a warning printed to stdErr, then the file will be
created if you ever store
java.io.IOException
Method Detail |
---|
public java.util.Enumeration enumerateDefaults()
public java.util.Enumeration enumerateNonDefaults()
protected java.net.InetSocketAddress parseInetSocketAddress(java.lang.String name) throws java.net.UnknownHostException
java.net.UnknownHostException
protected java.lang.String getProperty(java.lang.String name)
protected void setProperty(java.lang.String name, java.lang.String value)
name
- value
- store()
public void remove(java.lang.String name)
Parameters
remove
in interface Parameters
public boolean contains(java.lang.String name)
Parameters
contains
in interface Parameters
public int getInt(java.lang.String name)
getInt
in interface Parameters
public double getDouble(java.lang.String name)
getDouble
in interface Parameters
public float getFloat(java.lang.String name)
getFloat
in interface Parameters
public long getLong(java.lang.String name)
getLong
in interface Parameters
public boolean getBoolean(java.lang.String name)
getBoolean
in interface Parameters
public java.net.InetAddress getInetAddress(java.lang.String name) throws java.net.UnknownHostException
Parameters
getInetAddress
in interface Parameters
java.net.UnknownHostException
public java.net.InetSocketAddress getInetSocketAddress(java.lang.String name) throws java.net.UnknownHostException
Parameters
getInetSocketAddress
in interface Parameters
java.net.UnknownHostException
public java.net.InetSocketAddress[] getInetSocketAddressArray(java.lang.String name) throws java.net.UnknownHostException
Parameters
getInetSocketAddressArray
in interface Parameters
java.net.UnknownHostException
public java.lang.String getString(java.lang.String name)
getString
in interface Parameters
public java.lang.String[] getStringArray(java.lang.String name)
getStringArray
in interface Parameters
public void setInt(java.lang.String name, int value)
setInt
in interface Parameters
public void setDouble(java.lang.String name, double value)
setDouble
in interface Parameters
public void setFloat(java.lang.String name, float value)
setFloat
in interface Parameters
public void setLong(java.lang.String name, long value)
setLong
in interface Parameters
public void setBoolean(java.lang.String name, boolean value)
setBoolean
in interface Parameters
public void setInetAddress(java.lang.String name, java.net.InetAddress value)
setInetAddress
in interface Parameters
public void setInetSocketAddress(java.lang.String name, java.net.InetSocketAddress value)
setInetSocketAddress
in interface Parameters
public void setInetSocketAddressArray(java.lang.String name, java.net.InetSocketAddress[] value)
setInetSocketAddressArray
in interface Parameters
public void setString(java.lang.String name, java.lang.String value)
setString
in interface Parameters
public void setStringArray(java.lang.String name, java.lang.String[] value)
setStringArray
in interface Parameters
public void store() throws java.io.IOException
Parameters
store
in interface Parameters
java.io.IOException
public void addChangeListener(ParameterChangeListener p)
addChangeListener
in interface Parameters
public void removeChangeListener(ParameterChangeListener p)
removeChangeListener
in interface Parameters
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |