Runtime configuration of a GUI- or web-based component may be determined by data from an ordered set of sources. For example, a per-user preference setting may take precedence over per-device settings, which might take precedence over global settings. The PropertiesSource class attempts to address this by providing a mechanism by which "chains" of sources of properties may be established. When a request for a property is made, the each source in the chain is checked until a match is found.

Current implementations (in edu.vt.cs.collab.bridge.util) include:
  • SystemPropertiesSource, which extracts properties from the standard Java system properties mechanism. A number of properties (e.g., os name and java version) are set up automatically by the VM, and other properties may be specified on the command line when the VM is invoked.
  • DefaultPropertiesSource, which uses a standard java.util.Properties object to store and retrieve properties. The underlying properties object may be initialized in a number of ways, including from a configuration file. This makes it suitable for global configuration info, e.g., loaded from a resource in an application's jar file.
  • ServletPropertiesSource extracts properties from parameters and attributes in a servlet request object.
  • JNLPPersistencePropertiesSource saves and extracts properties using the cookie-like JNLP local persistence mechanism.
  • EmbeddedObjectDescriptorPropertiesSource extracts properties from an EmbeddedObjectDescriptor.

The goal of the PropertiesSource design is to allow ComponentView and WebView objects to discover relevant configuration information without explicit knowledge of where such information is stored. The task of determining appropriate sources (and ordering them correctly) is then left to the container which constructs and composes component or web views.


/public/projects/bridge/design/Management of property chains Login | Web Editor | Full Editor
Last modified 9/11/03 2:29 PM by isenhour (history)
Site contents