net.sourceforge.esw.properties
Class PropertyManager

java.lang.Object
  |
  +--net.sourceforge.esw.properties.PropertyManager

public class PropertyManager
extends java.lang.Object

Entry point to provide access to the properties framework.

Properties provide a way to parameterize the behavior of an application at run-time. Properties are data sources that contain information that alter the behavior of a program. Properties can be stored in any data source, whether it be XML, relational databases, or even URLs.

A data source containing a collection of Properties are encapsulated in an IPropertySource instance. An IPropertySource instance is an INode extension.

A single IPropertySource instance can be useful, but real benifit can be gained by aggregating IPropertySource instances together and allow ranking based access to those IPropertySource instances. The IPropertyAggregator interface provides aggregation across a list of IPropertySource instances. When an IPropertySource instance is added to an IPropertyAggregator instance, it is added at a specified rank. When interacting with an IPropertyAggregator instance, the Property returned will be pulled from the highest ranked IPropertySource that can return a valid value.

There is a default XML Properties file that this framework attempts to load from the current user directory. That IPropertySource instance is added as a 5th ranked IPropertySource to the default IPropertyAggregator instance. If you want to specify a different location for the default XML Properties file, you must set a system property. You can do this by either calling System.getProperties().put( PropUtil.SYSTEM_PROPERTIES_NAME, "myfile.xml" ), or by passing in a -Deswframework.properties=myfile.xml to the java runtime.

See Also:
IPropertySource, IPropertyAggregator

Field Summary
protected static IPropertyAggregator singleton
           
 
Constructor Summary
PropertyManager()
           
 
Method Summary
static IPropertyAggregator getPropertyAggregator()
          Returns the default IPropertyAggregator instance.
static void setPropertyAggregator(IPropertyAggregator thePropertyAggregator)
          Sets the IPropertyAggregator instance to be returned by this PropertyManager instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

protected static IPropertyAggregator singleton
Constructor Detail

PropertyManager

public PropertyManager()
Method Detail

getPropertyAggregator

public static IPropertyAggregator getPropertyAggregator()
Returns the default IPropertyAggregator instance.

setPropertyAggregator

public static void setPropertyAggregator(IPropertyAggregator thePropertyAggregator)
Sets the IPropertyAggregator instance to be returned by this PropertyManager instance.
Parameters:
thePropertyAggregator - the new IPropertyAggregator instance.


Copyright 2002 Free Software Foundation. All Rights Reserved.