Rice Pastry API

rice.environment.params.simple
Class SimpleParameters

java.lang.Object
  extended byrice.environment.params.simple.SimpleParameters
All Implemented Interfaces:
Parameters

public class SimpleParameters
extends java.lang.Object
implements Parameters

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...

Version:
$Id: pretty.settings 2305 2005-03-11 20:22:33Z jeffh $
Author:
Alan Mislove

Nested Class Summary
protected  class SimpleParameters.MyProperties
          DESCRIBE THE CLASS
 
Constructor Summary
SimpleParameters(java.lang.String[] orderedDefaults, java.lang.String mutableConfigFileName)
           
 
Method Summary
 void addChangeListener(ParameterChangeListener p)
          Adds a feature to the ChangeListener attribute of the SimpleParameters object
 boolean contains(java.lang.String name)
          DESCRIBE THE METHOD
 java.util.Enumeration enumerateDefaults()
          DESCRIBE THE METHOD
 java.util.Enumeration enumerateNonDefaults()
          DESCRIBE THE METHOD
 boolean getBoolean(java.lang.String name)
          Gets the Boolean attribute of the SimpleParameters object
 double getDouble(java.lang.String name)
          Gets the Double attribute of the SimpleParameters object
 float getFloat(java.lang.String name)
          Gets the Float attribute of the SimpleParameters object
 java.net.InetAddress getInetAddress(java.lang.String name)
          Gets the InetAddress attribute of the SimpleParameters object
 java.net.InetSocketAddress getInetSocketAddress(java.lang.String name)
          Gets the InetSocketAddress attribute of the SimpleParameters object
 java.net.InetSocketAddress[] getInetSocketAddressArray(java.lang.String name)
          Gets the InetSocketAddressArray attribute of the SimpleParameters object
 int getInt(java.lang.String name)
          Gets the Int attribute of the SimpleParameters object
 long getLong(java.lang.String name)
          Gets the Long attribute of the SimpleParameters object
protected  java.lang.String getProperty(java.lang.String name)
          Gets the Property attribute of the SimpleParameters object
 java.lang.String getString(java.lang.String name)
          Gets the String attribute of the SimpleParameters object
 java.lang.String[] getStringArray(java.lang.String name)
          Gets the StringArray attribute of the SimpleParameters object
protected  java.net.InetSocketAddress parseInetSocketAddress(java.lang.String name)
          DESCRIBE THE METHOD
 void remove(java.lang.String name)
          DESCRIBE THE METHOD
 void removeChangeListener(ParameterChangeListener p)
          DESCRIBE THE METHOD
 void setBoolean(java.lang.String name, boolean value)
          Sets the Boolean attribute of the SimpleParameters object
 void setDouble(java.lang.String name, double value)
          Sets the Double attribute of the SimpleParameters object
 void setFloat(java.lang.String name, float value)
          Sets the Float attribute of the SimpleParameters object
 void setInetAddress(java.lang.String name, java.net.InetAddress value)
          Sets the InetAddress attribute of the SimpleParameters object
 void setInetSocketAddress(java.lang.String name, java.net.InetSocketAddress value)
          Sets the InetSocketAddress attribute of the SimpleParameters object
 void setInetSocketAddressArray(java.lang.String name, java.net.InetSocketAddress[] value)
          Sets the InetSocketAddressArray attribute of the SimpleParameters object
 void setInt(java.lang.String name, int value)
          Sets the Int attribute of the SimpleParameters object
 void setLong(java.lang.String name, long value)
          Sets the Long attribute of the SimpleParameters object
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)
          Sets the String attribute of the SimpleParameters object
 void setStringArray(java.lang.String name, java.lang.String[] value)
          Sets the StringArray attribute of the SimpleParameters object
 void store()
          DESCRIBE THE METHOD
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleParameters

public SimpleParameters(java.lang.String[] orderedDefaults,
                        java.lang.String mutableConfigFileName)
Parameters:
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
Throws:
java.io.IOException
Method Detail

getProperty

protected java.lang.String getProperty(java.lang.String name)
Gets the Property attribute of the SimpleParameters object

Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Property value

getInt

public int getInt(java.lang.String name)
Gets the Int attribute of the SimpleParameters object

Specified by:
getInt in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Int value

getDouble

public double getDouble(java.lang.String name)
Gets the Double attribute of the SimpleParameters object

Specified by:
getDouble in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Double value

getFloat

public float getFloat(java.lang.String name)
Gets the Float attribute of the SimpleParameters object

Specified by:
getFloat in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Float value

getLong

public long getLong(java.lang.String name)
Gets the Long attribute of the SimpleParameters object

Specified by:
getLong in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Long value

getBoolean

public boolean getBoolean(java.lang.String name)
Gets the Boolean attribute of the SimpleParameters object

Specified by:
getBoolean in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The Boolean value

getInetAddress

public java.net.InetAddress getInetAddress(java.lang.String name)
                                    throws java.net.UnknownHostException
Gets the InetAddress attribute of the SimpleParameters object

Specified by:
getInetAddress in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The InetAddress value
Throws:
java.net.UnknownHostException - DESCRIBE THE EXCEPTION

getInetSocketAddress

public java.net.InetSocketAddress getInetSocketAddress(java.lang.String name)
                                                throws java.net.UnknownHostException
Gets the InetSocketAddress attribute of the SimpleParameters object

Specified by:
getInetSocketAddress in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The InetSocketAddress value
Throws:
java.net.UnknownHostException - DESCRIBE THE EXCEPTION

getInetSocketAddressArray

public java.net.InetSocketAddress[] getInetSocketAddressArray(java.lang.String name)
                                                       throws java.net.UnknownHostException
Gets the InetSocketAddressArray attribute of the SimpleParameters object

Specified by:
getInetSocketAddressArray in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The InetSocketAddressArray value
Throws:
java.net.UnknownHostException - DESCRIBE THE EXCEPTION

getString

public java.lang.String getString(java.lang.String name)
Gets the String attribute of the SimpleParameters object

Specified by:
getString in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The String value

getStringArray

public java.lang.String[] getStringArray(java.lang.String name)
Gets the StringArray attribute of the SimpleParameters object

Specified by:
getStringArray in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
The StringArray value

setProperty

protected void setProperty(java.lang.String name,
                           java.lang.String value)
Note, this method does not implicitly call store()

Parameters:
name -
value -
See Also:
store()

setInt

public void setInt(java.lang.String name,
                   int value)
Sets the Int attribute of the SimpleParameters object

Specified by:
setInt in interface Parameters
Parameters:
name - The new Int value
value - The new Int value

setDouble

public void setDouble(java.lang.String name,
                      double value)
Sets the Double attribute of the SimpleParameters object

Specified by:
setDouble in interface Parameters
Parameters:
name - The new Double value
value - The new Double value

setFloat

public void setFloat(java.lang.String name,
                     float value)
Sets the Float attribute of the SimpleParameters object

Specified by:
setFloat in interface Parameters
Parameters:
name - The new Float value
value - The new Float value

setLong

public void setLong(java.lang.String name,
                    long value)
Sets the Long attribute of the SimpleParameters object

Specified by:
setLong in interface Parameters
Parameters:
name - The new Long value
value - The new Long value

setBoolean

public void setBoolean(java.lang.String name,
                       boolean value)
Sets the Boolean attribute of the SimpleParameters object

Specified by:
setBoolean in interface Parameters
Parameters:
name - The new Boolean value
value - The new Boolean value

setInetAddress

public void setInetAddress(java.lang.String name,
                           java.net.InetAddress value)
Sets the InetAddress attribute of the SimpleParameters object

Specified by:
setInetAddress in interface Parameters
Parameters:
name - The new InetAddress value
value - The new InetAddress value

setInetSocketAddress

public void setInetSocketAddress(java.lang.String name,
                                 java.net.InetSocketAddress value)
Sets the InetSocketAddress attribute of the SimpleParameters object

Specified by:
setInetSocketAddress in interface Parameters
Parameters:
name - The new InetSocketAddress value
value - The new InetSocketAddress value

setInetSocketAddressArray

public void setInetSocketAddressArray(java.lang.String name,
                                      java.net.InetSocketAddress[] value)
Sets the InetSocketAddressArray attribute of the SimpleParameters object

Specified by:
setInetSocketAddressArray in interface Parameters
Parameters:
name - The new InetSocketAddressArray value
value - The new InetSocketAddressArray value

setString

public void setString(java.lang.String name,
                      java.lang.String value)
Sets the String attribute of the SimpleParameters object

Specified by:
setString in interface Parameters
Parameters:
name - The new String value
value - The new String value

setStringArray

public void setStringArray(java.lang.String name,
                           java.lang.String[] value)
Sets the StringArray attribute of the SimpleParameters object

Specified by:
setStringArray in interface Parameters
Parameters:
name - The new StringArray value
value - The new StringArray value

enumerateDefaults

public java.util.Enumeration enumerateDefaults()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

enumerateNonDefaults

public java.util.Enumeration enumerateNonDefaults()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

parseInetSocketAddress

protected java.net.InetSocketAddress parseInetSocketAddress(java.lang.String name)
                                                     throws java.net.UnknownHostException
DESCRIBE THE METHOD

Parameters:
name - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE
Throws:
java.net.UnknownHostException - DESCRIBE THE EXCEPTION

remove

public void remove(java.lang.String name)
DESCRIBE THE METHOD

Specified by:
remove in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER

contains

public boolean contains(java.lang.String name)
DESCRIBE THE METHOD

Specified by:
contains in interface Parameters
Parameters:
name - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

store

public void store()
           throws java.io.IOException
DESCRIBE THE METHOD

Specified by:
store in interface Parameters
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

addChangeListener

public void addChangeListener(ParameterChangeListener p)
Adds a feature to the ChangeListener attribute of the SimpleParameters object

Specified by:
addChangeListener in interface Parameters
Parameters:
p - The feature to be added to the ChangeListener attribute

removeChangeListener

public void removeChangeListener(ParameterChangeListener p)
DESCRIBE THE METHOD

Specified by:
removeChangeListener in interface Parameters
Parameters:
p - DESCRIBE THE PARAMETER

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection