    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.daemon.DaemonProperties

    java.lang.Object
       |
       +----org.w3c.jigsaw.daemon.DaemonProperties

public class DaemonProperties
extends Object

Subclass of Properties, to deal with daemon specific usage of them. This class refines the basic Properties class, in order to tune them for ServerHandler specific needs:

- Properties can be observed through the PropertyMonitoring interface,
- Properties are multiplexed according to the server identifier. Two servers can rely on the same set of properties, but each of them can have its own property value. Eg the org.w3c.jigsaw.http package host property can be set fro server1 to host1 and for server2 to host2. This is done by defining server1.org.w3c.jigsaw.http.host and server2.org.w3c.jigsaw.http.host

Each property can be monitored, to allow for dynamic reconfiguration of the server.

See Also:
  PropertyMonitoring

##

configdir
  Our base config directory.
globprops
  The global set of properties (inherited by all spaces).
propspace
  The set of loaded properties set.

##

DaemonProperties(File, Properties)

##

getProperty(String)
getPropertySpace(String)
  Get the properties for the given space.
getString(String, String)
load(InputStream)
loadPropertySpace(String)
  Load in the default properties for the given space.
loadPropertySpace(String, InputStream)
  Extend a property space.
save()
savePropertySpace(String)

##

propspace

     protected Hashtable propspace

  The set of loaded properties set.

globprops

     protected Properties globprops

  The global set of properties (inherited by all spaces).

configdir

     protected File configdir

  Our base config directory.

##

DaemonProperties

     public DaemonProperties(File configdir,
                             Properties props)

  Parameters:
    props - The global properties to use in all spaces.

##

loadPropertySpace

     public ObservableProperties loadPropertySpace(String id,
                                                   InputStream in) throws IOException

  Extend a property space.

  Parameters:
    id - The identifier of the property set to extend.
    in - The input stream containing Java properties to add.
  Throws: IOException
    If the input stream couldn't be read.

loadPropertySpace

     public ObservableProperties loadPropertySpace(String id) throws IOException, FileNotFoundException

  Load in the default properties for the given space. The file from which properties are loaded is kept itself as the `org.w3c.jigsaw.propfile` property.

  Parameters:
    id - The identifier of the property set to load.
  Throws: FileNotFoundException
    If the default property file wasn't found.
  Throws: IOException
    If default property file couldn't be read.

getPropertySpace

     public ObservableProperties getPropertySpace(String id)

  Get the properties for the given space.

  Parameters:
    id - The identifier for a property set space.
  Returns:
    An ObservableProperties instance, or null.

save

     public void save()

savePropertySpace

     public void savePropertySpace(String id)

load

     public void load(InputStream in) throws IOException

getProperty

     public String getProperty(String name)

getString

     public String getString(String name,
                             String def)

    All Packages  Class Hierarchy  This Package  Previous  Next  Index