org.exolab.jms.config
Class ConfigurationReader

java.lang.Object
  |
  +--org.exolab.jms.config.ConfigurationReader

public final class ConfigurationReader
extends java.lang.Object

The ConfigurationReader reads a Configuration document and populates unset items with those provided by DefaultConfiguration.

Version:
$Revision: 1.1 $ $Date: 2005/10/20 14:13:25 $
Author:
Tim Anderson
See Also:
Configuration

Method Summary
static Configuration read(java.io.InputStream stream)
          Loads the configuration from a stream.
static Configuration read(java.lang.String path)
          Loads the configuration information from the specified file.
static Configuration setDefaults(Configuration config)
          Sets unpopulated elements in the supplied configuration with default values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static Configuration read(java.lang.String path)
                          throws java.io.IOException,
                                 org.exolab.castor.xml.MarshalException,
                                 org.exolab.castor.xml.ValidationException
Loads the configuration information from the specified file. Unpopulated configuration elements will be set to those provided by DefaultConfiguration.
Parameters:
path - the path to the file
Returns:
the configuration
Throws:
java.io.IOException - for any I/O error
org.exolab.castor.xml.MarshalException - if there is an error during unmarshalling
org.exolab.castor.xml.ValidationException - if there is a validation error

read

public static Configuration read(java.io.InputStream stream)
                          throws java.io.IOException,
                                 org.exolab.castor.xml.MarshalException,
                                 org.exolab.castor.xml.ValidationException
Loads the configuration from a stream. Unpopulated configuration elements will be set to those provided by DefaultConfiguration.
Parameters:
stream - the stream to read from
Returns:
the configuration
Throws:
java.io.IOException - for any I/O error
org.exolab.castor.xml.MarshalException - if there is an error during unmarshalling
org.exolab.castor.xml.ValidationException - if there is a validation error

setDefaults

public static Configuration setDefaults(Configuration config)
                                 throws java.io.IOException,
                                        org.exolab.castor.xml.MarshalException,
                                        org.exolab.castor.xml.ValidationException
Sets unpopulated elements in the supplied configuration with default values. The default values are provided by DefaultConfiguration.
Parameters:
config - the configuration
Returns:
the configuration, with unpopulated elements set to the defaults
Throws:
java.io.IOException - for any I/O error
org.exolab.castor.xml.MarshalException - if there is an error during unmarshalling
org.exolab.castor.xml.ValidationException - if there is a validation error


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.