Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services

Class Configuration

com.gentleware.services.Configuration

public class Configuration


Configuration provides a simple persistency service.

Basic data types can be stored and retrieved from a properties file. The interface is modeled after java.util.prefs.Preferences. Values are automatically written back to the properties file (lazily after some delay or when the Runtime executes its shutdown hooks).

Authors:
Stephen Kelvin


 Inner Classifier Summary
public   Configuration.Listener
 
private static   Configuration.ListenerEntry
 
arrow_up
 

 Attribute Summary
private static int  SAVE_DELAY
 
private String  _fileName
 
private String  _keyPrefix
The common prefix of all entries. 
private Set  _listenerEntries
 
private boolean  _loaded
 
private Properties  _properties
 
private String  _propertiesHeader
 
private ActionListener  _saveListener
 
private Timer  _saveTimer
 
private Thread  _shutdownThread
 
arrow_up
 

 Association Summary
public ProfileRegistry  profileRegistry
 
public Services  services
 
arrow_up
 

 Constructor Summary
public   Configuration(String fileName, String propertiesHeader)
 
arrow_up
 

 Method Summary
public void   addListener(Configuration.Listener listener, String key)
 
private void   checkFireListeners(String key)
 
private void   checkLoaded()
 
public boolean   containsKey(String key)
 
public boolean   flush()
 
public String   get(String key)
 
public String   get(String key, String defaultValue)
 
public Map   getAllEntriesMatching(String keyPart)
 
public boolean   getBoolean(String key)
 
public boolean   getBoolean(String key, boolean defaultValue)
 
public String   getDecrypted(String key)
 
public String   getDecrypted(String key, String defaultValue)
 
public double   getDouble(String key)
 
public double   getDouble(String key, double defaultValue)
 
public String   getFileName()
 
public float   getFloat(String key)
 
public float   getFloat(String key, float defaultValue)
 
public int   getInteger(String key)
 
public int   getInteger(String key, int defaultValue)
 
public String   getKeyPrefix()
 
public long   getLong(String key)
 
public long   getLong(String key, long defaultValue)
 
public String   getString(String key)
 
public String   getString(String key, String defaultValue)
 
public String   makeKey(String s1)
 
public String   makeKey(String s1, String s2)
 
public String   makeKey(String s1, String s2, String s3)
 
public String   makeKey(String s1, String s2, String s3, String s4)
 
public String   makeKey(String s1, String s2, String s3, String s4, String s5)
 
public void   put(String key, String value)
 
public void   putBoolean(String key, boolean value)
 
public void   putDouble(String key, double value)
 
public void   putEncrypted(String key, String value)
 
public void   putFloat(String key, float value)
 
public void   putInteger(String key, int value)
 
public void   putLong(String key, long value)
 
public void   putString(String key, String value)
 
public void   removeKey(String key)
 
public void   removeListener(Configuration.Listener listener, String key)
 
private void   save()
 
private boolean   saveNow()
 
public void   setKeyPrefix(String keyPrefix)
 
arrow_up
 

Tagged Values
static false
 

 Inner Classifier Detail

Configuration.Listener

public  Configuration.Listener

arrow_up


Configuration.ListenerEntry

private static  Configuration.ListenerEntry

arrow_up
 Attribute Detail

SAVE_DELAY

private static int SAVE_DELAY

arrow_up


_fileName

private String _fileName

arrow_up


_keyPrefix

private String _keyPrefix

The common prefix of all entries.  
arrow_up


_listenerEntries

private Set _listenerEntries

arrow_up


_loaded

private boolean _loaded

arrow_up


_properties

private Properties _properties

arrow_up


_propertiesHeader

private String _propertiesHeader

arrow_up


_saveListener

private ActionListener _saveListener

arrow_up


_saveTimer

private Timer _saveTimer

arrow_up


_shutdownThread

private Thread _shutdownThread

arrow_up
 Association Detail

profileRegistry

public ProfileRegistry profileRegistry

arrow_up


services

public Services services

arrow_up
 Constructor Detail

Configuration

public Configuration Configuration(String fileName, String propertiesHeader)

Parameters:
fileName -
propertiesHeader -
Returns:
arrow_up
 Method Detail

addListener

public void addListener(Configuration.Listener listener, String key)

Parameters:
listener -
key -
arrow_up


checkFireListeners

private void checkFireListeners(String key)

Parameters:
key -
arrow_up


checkLoaded

private void checkLoaded()

arrow_up


containsKey

public boolean containsKey(String key)

Parameters:
key -
Returns:
true if the key is already contained in the list of known keys.
arrow_up


flush

public boolean flush()

Returns:
arrow_up


get

public String get(String key)

Parameters:
key - The configuration key
Returns:
The value saved under the key, or "" if key not found.
arrow_up


get

public String get(String key, String defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getAllEntriesMatching

public Map getAllEntriesMatching(String keyPart)

Parameters:
keyPart -
Returns:
arrow_up


getBoolean

public boolean getBoolean(String key)

Parameters:
key -
Returns:
The value for the key, default is false.
arrow_up


getBoolean

public boolean getBoolean(String key, boolean defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getDecrypted

public String getDecrypted(String key)

Parameters:
key -
Returns:
arrow_up


getDecrypted

public String getDecrypted(String key, String defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getDouble

public double getDouble(String key)

Parameters:
key -
Returns:
The value stored under the key, or 0 (zero).
arrow_up


getDouble

public double getDouble(String key, double defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getFileName

public String getFileName()

Returns:
arrow_up


getFloat

public float getFloat(String key)

Parameters:
key -
Returns:
The value stored under the key, or 0 (zero).
arrow_up


getFloat

public float getFloat(String key, float defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getInteger

public int getInteger(String key)

Parameters:
key -
Returns:
The value stored under the key, or 0 (zero).
arrow_up


getInteger

public int getInteger(String key, int defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getKeyPrefix

public String getKeyPrefix()

Returns:
arrow_up


getLong

public long getLong(String key)

Parameters:
key -
Returns:
The value stored under the key, or 0 (zero).
arrow_up


getLong

public long getLong(String key, long defaultValue)

Parameters:
key -
defaultValue -
Returns:
arrow_up


getString

public String getString(String key)

Parameters:
key - The configuration key
Returns:
The value saved under the key, or "" if key not found.
arrow_up


getString

public String getString(String key, String defaultValue)

Parameters:
key - The configuration key
defaultValue - A default value to use when the key was not found
Returns:
The value saved under the key, or the defaultValue if key not found.
arrow_up


makeKey

public String makeKey(String s1)

Parameters:
s1 -
Returns:
arrow_up


makeKey

public String makeKey(String s1, String s2)

Parameters:
s1 -
s2 -
Returns:
arrow_up


makeKey

public String makeKey(String s1, String s2, String s3)

Parameters:
s1 -
s2 -
s3 -
Returns:
arrow_up


makeKey

public String makeKey(String s1, String s2, String s3, String s4)

Parameters:
s1 -
s2 -
s3 -
s4 -
Returns:
arrow_up


makeKey

public String makeKey(String s1, String s2, String s3, String s4, String s5)

Parameters:
s1 -
s2 -
s3 -
s4 -
s5 -
Returns:
arrow_up


put

public void put(String key, String value)

Parameters:
key -
value -
arrow_up


putBoolean

public void putBoolean(String key, boolean value)

Parameters:
key -
value -
arrow_up


putDouble

public void putDouble(String key, double value)

Parameters:
key -
value -
arrow_up


putEncrypted

public void putEncrypted(String key, String value)

Parameters:
key -
value -
arrow_up


putFloat

public void putFloat(String key, float value)

Parameters:
key -
value -
arrow_up


putInteger

public void putInteger(String key, int value)

Parameters:
key -
value -
arrow_up


putLong

public void putLong(String key, long value)

Parameters:
key -
value -
arrow_up


putString

public void putString(String key, String value)

Parameters:
key -
value -
arrow_up


removeKey

public void removeKey(String key)

Parameters:
key -
arrow_up


removeListener

public void removeListener(Configuration.Listener listener, String key)

Parameters:
listener -
key -
arrow_up


save

private void save()

arrow_up


saveNow

private boolean saveNow()

Returns:
arrow_up


setKeyPrefix

public void setKeyPrefix(String keyPrefix)

Parameters:
keyPrefix -
arrow_up
Created  2004 - 10 - 21

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.