Class AbstractConfigurationProvider
- java.lang.Object
-
- 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
Constructors Constructor Description AbstractConfigurationProvider(TorqueGeneratorPaths configurationPaths)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description InputStreamgetControlConfigurationInputStream()Creates a reader to access the control configuration.protected abstract InputStreamgetInputStream(String name, String directory, String fileDescription)InputStreamgetOptionsInputStream(String name)Creates a reader to access an options file.InputStreamgetOutletConfigurationInputStream(String name)Creates a reader to access the configuration for one outlet.InputStreamgetResourceInputStream(String name)Creates a reader to access a resource file.InputStreamgetTemplateInputStream(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, getTemplateNames
-
-
-
-
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:ConfigurationProviderCreates a reader to access the control configuration. It is the callers responsibility to close the reader after use.- Specified by:
getControlConfigurationInputStreamin interfaceConfigurationProvider- 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:ConfigurationProviderCreates a reader to access a template. It is the callers responsibility to close the reader after use.- Specified by:
getTemplateInputStreamin interfaceConfigurationProvider- 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:ConfigurationProviderCreates a reader to access the configuration for one outlet. It is the callers responsibility to close the reader after use.- Specified by:
getOutletConfigurationInputStreamin interfaceConfigurationProvider- 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:ConfigurationProviderCreates a reader to access a resource file. It is the callers responsibility to close the reader after use.- Specified by:
getResourceInputStreamin interfaceConfigurationProvider- 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:ConfigurationProviderCreates a reader to access an options file. It is the callers responsibility to close the reader after use.- Specified by:
getOptionsInputStreamin interfaceConfigurationProvider- 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
- Parameters:
name- input stream namedirectory- locationfileDescription- describes the file- Returns:
- an InputStream
- Throws:
ConfigurationException- if unable to process
-
-