org.infinispan.config.parsing
Interface XmlConfigurationParser

All Known Implementing Classes:
XmlConfigurationParserImpl

public interface XmlConfigurationParser

Implementations of this interface are responsible for parsing XML configuration files.

Since:
4.0
Author:
Manik Surtani

Method Summary
 void initialize(InputStream inputStream)
          Initializes the parser with a stream that contains the contents of an XML configuration file to parse.
 void initialize(String fileName)
          Initializes the parser with a String that represents the name of the configuration file to parse.
 Configuration parseDefaultConfiguration()
          Parses the default template configuration.
 GlobalConfiguration parseGlobalConfiguration()
          GlobalConfiguration would also have a reference to the template default configuration, accessible via GlobalConfiguration.getDefaultConfiguration()

This is typically used to configure a DefaultCacheManager

 Map<String,Configuration> parseNamedConfigurations()
          Parses and retrieves configuration overrides for named caches.
 

Method Detail

initialize

void initialize(String fileName)
                throws IOException
Initializes the parser with a String that represents the name of the configuration file to parse. Parsers would attempt to find this file on the classpath first, and failing that, treat the String as an absolute path name on the file system.

Parameters:
fileName - name of file that contains the XML configuration
Throws:
IOException - if there is a problem reading the configuration file

initialize

void initialize(InputStream inputStream)
                throws IOException
Initializes the parser with a stream that contains the contents of an XML configuration file to parse.

Parameters:
inputStream - stream to read from
Throws:
IOException - if there is a problem reading from the stream

parseDefaultConfiguration

Configuration parseDefaultConfiguration()
                                        throws ConfigurationException
Parses the default template configuration.

Returns:
a configuration instance representing the "default" block in the configuration file
Throws:
ConfigurationException - if there is a problem parsing the configuration XML

parseNamedConfigurations

Map<String,Configuration> parseNamedConfigurations()
                                                   throws ConfigurationException
Parses and retrieves configuration overrides for named caches.

Returns:
a Map of Configuration overrides keyed on cache name
Throws:
ConfigurationException - if there is a problem parsing the configuration XML

parseGlobalConfiguration

GlobalConfiguration parseGlobalConfiguration()
GlobalConfiguration would also have a reference to the template default configuration, accessible via GlobalConfiguration.getDefaultConfiguration()

This is typically used to configure a DefaultCacheManager

Returns:
a GlobalConfiguration as parsed from the configuration file.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.