org.apache.torque.generator.configuration
Class AbstractConfigurationProvider

java.lang.Object
  extended by org.apache.torque.generator.configuration.AbstractConfigurationProvider
All Implemented Interfaces:
ConfigurationProvider
Direct Known Subclasses:
ClasspathConfigurationProvider, DirectoryConfigurationProvider, JarConfigurationProvider

public abstract class AbstractConfigurationProvider
extends Object
implements ConfigurationProvider

A base class for all ConfigurationProvider implementations.

Version:
$Id: $

Constructor Summary
AbstractConfigurationProvider(TorqueGeneratorPaths configurationPaths)
          Constructor.
 
Method Summary
 InputStream getControlConfigurationInputStream()
          Creates a reader to access the control configuration.
protected abstract  InputStream getInputStream(String name, String directory, String fileDescription)
           
 InputStream getOptionsInputStream(String name)
          Creates a reader to access an options file.
 InputStream getOutletConfigurationInputStream(String name)
          Creates a reader to access the configuration for one outlet.
 InputStream getResourceInputStream(String name)
          Creates a reader to access a resource file.
 InputStream getTemplateInputStream(String name)
          Creates a reader to access a template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.torque.generator.configuration.ConfigurationProvider
getControlConfigurationLocation, getOutletConfigurationNames
 

Constructor Detail

AbstractConfigurationProvider

public AbstractConfigurationProvider(TorqueGeneratorPaths configurationPaths)
Constructor.

Parameters:
configurationPaths - The internal directory structure of the Torque generator configuration files, not null.
Throws:
NullPointerException - if configurationPaths is null.
Method Detail

getControlConfigurationInputStream

public InputStream getControlConfigurationInputStream()
                                               throws ConfigurationException
Description copied from interface: ConfigurationProvider
Creates a reader to access the control configuration. It is the callers responsibility to close the reader after use.

Specified by:
getControlConfigurationInputStream in interface ConfigurationProvider
Returns:
a reader to access the control configuration, never null.
Throws:
ConfigurationException - if the reader can not be created.

getTemplateInputStream

public InputStream getTemplateInputStream(String name)
                                   throws ConfigurationException
Description copied from interface: ConfigurationProvider
Creates a reader to access a template. It is the callers responsibility to close the reader after use.

Specified by:
getTemplateInputStream in interface ConfigurationProvider
Parameters:
name - the name (==path to) of the template.
Returns:
a reader to access a template, never null.
Throws:
ConfigurationException - if the reader can not be created.

getOutletConfigurationInputStream

public InputStream getOutletConfigurationInputStream(String name)
                                              throws ConfigurationException
Description copied from interface: ConfigurationProvider
Creates a reader to access the configuration for one outlet. It is the callers responsibility to close the reader after use.

Specified by:
getOutletConfigurationInputStream in interface ConfigurationProvider
Parameters:
name - the name (==path to) of the outlet configuration.
Returns:
a reader to access the outlet configuration, never null.
Throws:
ConfigurationException - if the reader can not be created.

getResourceInputStream

public InputStream getResourceInputStream(String name)
                                   throws ConfigurationException
Description copied from interface: ConfigurationProvider
Creates a reader to access a resource file. It is the callers responsibility to close the reader after use.

Specified by:
getResourceInputStream in interface ConfigurationProvider
Parameters:
name - the path to of the resource file.
Returns:
a reader to access the options file, never null.
Throws:
ConfigurationException - if the reader can not be created.

getOptionsInputStream

public InputStream getOptionsInputStream(String name)
                                  throws ConfigurationException
Description copied from interface: ConfigurationProvider
Creates a reader to access an options file. It is the callers responsibility to close the reader after use.

Specified by:
getOptionsInputStream in interface ConfigurationProvider
Parameters:
name - the name (==path to) of the options file.
Returns:
a reader to access the options file, never null.
Throws:
ConfigurationException - if the reader can not be created.

getInputStream

protected abstract InputStream getInputStream(String name,
                                              String directory,
                                              String fileDescription)
                                       throws ConfigurationException
Throws:
ConfigurationException


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.