org.infinispan.config.parsing
Class AutomatedXmlConfigurationParserImpl

java.lang.Object
  extended by org.infinispan.config.parsing.XmlParserBase
      extended by org.infinispan.config.parsing.AutomatedXmlConfigurationParserImpl
All Implemented Interfaces:
XmlConfigurationParser

public class AutomatedXmlConfigurationParserImpl
extends XmlParserBase
implements XmlConfigurationParser

XML configuration parser that uses reflection API and annotations to read Infinispan configuration files.

Since:
4.0
Author:
Vladimir Blagojevic

Constructor Summary
AutomatedXmlConfigurationParserImpl()
          Constructs a new parser
AutomatedXmlConfigurationParserImpl(InputStream inputStream)
          Constructs a parser and initializes it with the input stream passed in, by calling initialize(InputStream).
AutomatedXmlConfigurationParserImpl(String fileName)
          Constructs a parser and initializes it with the file name passed in, by calling initialize(String).
 
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.
 
Methods inherited from class org.infinispan.config.parsing.XmlParserBase
existsAttribute, getAllElements, getAllElementsInCoreNS, getAttributeValue, getBoolean, getInt, getLong, getSingleElement, getSingleElementInCoreNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutomatedXmlConfigurationParserImpl

public AutomatedXmlConfigurationParserImpl()
Constructs a new parser


AutomatedXmlConfigurationParserImpl

public AutomatedXmlConfigurationParserImpl(String fileName)
                                    throws IOException
Constructs a parser and initializes it with the file name passed in, by calling initialize(String).

Parameters:
fileName - file name to initialize the parser with
Throws:
IOException - if there is a problem reading or locating the file.

AutomatedXmlConfigurationParserImpl

public AutomatedXmlConfigurationParserImpl(InputStream inputStream)
                                    throws IOException
Constructs a parser and initializes it with the input stream passed in, by calling initialize(InputStream).

Parameters:
inputStream - input stream to initialize the parser with
Throws:
IOException - if there is a problem reading the stream
Method Detail

initialize

public void initialize(String fileName)
                throws IOException
Description copied from interface: XmlConfigurationParser
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.

Specified by:
initialize in interface XmlConfigurationParser
Parameters:
fileName - name of file that contains the XML configuration
Throws:
IOException - if there is a problem reading the configuration file

initialize

public void initialize(InputStream inputStream)
                throws IOException
Description copied from interface: XmlConfigurationParser
Initializes the parser with a stream that contains the contents of an XML configuration file to parse.

Specified by:
initialize in interface XmlConfigurationParser
Parameters:
inputStream - stream to read from
Throws:
IOException - if there is a problem reading from the stream

parseDefaultConfiguration

public Configuration parseDefaultConfiguration()
                                        throws ConfigurationException
Description copied from interface: XmlConfigurationParser
Parses the default template configuration.

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

parseNamedConfigurations

public Map<String,Configuration> parseNamedConfigurations()
                                                   throws ConfigurationException
Description copied from interface: XmlConfigurationParser
Parses and retrieves configuration overrides for named caches.

Specified by:
parseNamedConfigurations in interface XmlConfigurationParser
Returns:
a Map of Configuration overrides keyed on cache name
Throws:
ConfigurationException - if there is a problem parsing the configuration XML

parseGlobalConfiguration

public GlobalConfiguration parseGlobalConfiguration()
Description copied from interface: XmlConfigurationParser
GlobalConfiguration would also have a reference to the template default configuration, accessible via GlobalConfiguration.getDefaultConfiguration()

This is typically used to configure a DefaultCacheManager

Specified by:
parseGlobalConfiguration in interface XmlConfigurationParser
Returns:
a GlobalConfiguration as parsed from the configuration file.

Google Analytics

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