|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.config.xml.XmlConfiguration
public class XmlConfiguration
Exposes Configuration and CacheConfigurationBuilder expressed
in a XML file that obeys the ehcache-core.xsd (todo link this to proper location, wherever this ends up being)
Instances of this class are not thread-safe
| Constructor Summary | |
|---|---|
XmlConfiguration(java.net.URL url)
Constructs an instance of XmlConfiguration mapping to the XML file located at url |
|
XmlConfiguration(java.net.URL url,
java.lang.ClassLoader classLoader)
Constructs an instance of XmlConfiguration mapping to the XML file located at url and using the provided
classLoader to load user types (e.g. |
|
XmlConfiguration(java.net.URL url,
java.lang.ClassLoader classLoader,
java.util.Map<java.lang.String,java.lang.ClassLoader> cacheClassLoaders)
Constructs an instance of XmlConfiguration mapping to the XML file located at url and using the provided
classLoader to load user types (e.g. |
|
| Method Summary | ||
|---|---|---|
java.util.Map<java.lang.String,CacheConfiguration<?,?>> |
getCacheConfigurations()
Mapping of names to CacheConfiguration, used to create the named Cache
managed by a CacheManager |
|
java.lang.ClassLoader |
getClassLoader()
The ClassLoader to be associated with the CacheManager |
|
java.util.Collection<ServiceCreationConfiguration<?>> |
getServiceCreationConfigurations()
All services initially used to bootstrap the CacheManager and
its Cache instances |
|
java.net.URL |
getURL()
Exposes the URL where the XML file parsed or yet to be parsed was or will be sourced from. |
|
CacheConfigurationBuilder<java.lang.Object,java.lang.Object> |
newCacheConfigurationBuilderFromTemplate(java.lang.String name)
Creates a new CacheConfigurationBuilder seeded with the cache-template configuration
by the given name in the XML configuration parsed using parseConfiguration() |
|
|
newCacheConfigurationBuilderFromTemplate(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Creates a new CacheConfigurationBuilder seeded with the cache-template configuration
by the given name in the XML configuration parsed using parseConfiguration() |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlConfiguration(java.net.URL url)
throws java.lang.ClassNotFoundException,
org.xml.sax.SAXException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.io.IOException
url
Parses the XML file at the url provided.
url - URL pointing to the XML file's location
java.io.IOException - if anything went wrong accessing the URL
org.xml.sax.SAXException - if anything went wrong parsing or validating the XML
java.lang.ClassNotFoundException - if a Class declared in the XML couldn't be found
java.lang.InstantiationException - if a user provided Class couldn't get instantiated
java.lang.IllegalAccessException - if a method (including constructor) couldn't be invoked on a user provided type
public XmlConfiguration(java.net.URL url,
java.lang.ClassLoader classLoader)
throws java.lang.ClassNotFoundException,
org.xml.sax.SAXException,
java.lang.InstantiationException,
java.io.IOException,
java.lang.IllegalAccessException
url and using the provided
classLoader to load user types (e.g. key and value Class instances).
Parses the XML file at the url provided.
url - URL pointing to the XML file's locationclassLoader - ClassLoader to use to load user types.
java.io.IOException - if anything went wrong accessing the URL
org.xml.sax.SAXException - if anything went wrong parsing or validating the XML
java.lang.ClassNotFoundException - if a Class declared in the XML couldn't be found
java.lang.InstantiationException - if a user provided Class couldn't get instantiated
java.lang.IllegalAccessException - if a method (including constructor) couldn't be invoked on a user provided type
public XmlConfiguration(java.net.URL url,
java.lang.ClassLoader classLoader,
java.util.Map<java.lang.String,java.lang.ClassLoader> cacheClassLoaders)
throws java.lang.ClassNotFoundException,
org.xml.sax.SAXException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.io.IOException
url and using the provided
classLoader to load user types (e.g. key and value Class instances). The cacheClassLoaders will
let you specify a different ClassLoader to use for each Cache managed by
the CacheManager configured using this XmlConfiguration
Parses the XML file at the url provided.
url - URL pointing to the XML file's locationclassLoader - ClassLoader to use to load user types.cacheClassLoaders - the map with mappings between cache names and the corresponding class loaders
java.io.IOException - if anything went wrong accessing the URL
org.xml.sax.SAXException - if anything went wrong parsing or validating the XML
java.lang.ClassNotFoundException - if a Class declared in the XML couldn't be found
java.lang.InstantiationException - if a user provided Class couldn't get instantiated
java.lang.IllegalAccessException - if a method (including constructor) couldn't be invoked on a user provided type| Method Detail |
|---|
public java.net.URL getURL()
public CacheConfigurationBuilder<java.lang.Object,java.lang.Object> newCacheConfigurationBuilderFromTemplate(java.lang.String name)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException
CacheConfigurationBuilder seeded with the cache-template configuration
by the given name in the XML configuration parsed using parseConfiguration()
name - the unique name identifying the cache-template element in the XML
CacheConfigurationBuilder
or null if no cache-template for the provided name
java.lang.ClassNotFoundException - if a Class declared in the XML couldn't be found
java.lang.InstantiationException - if a user provided Class couldn't get instantiated
java.lang.IllegalAccessException - if a method (including constructor) couldn't be invoked on a user provided type
public <K,V> CacheConfigurationBuilder<K,V> newCacheConfigurationBuilderFromTemplate(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException
CacheConfigurationBuilder seeded with the cache-template configuration
by the given name in the XML configuration parsed using parseConfiguration()
K - type of keysV - type of valuesname - the unique name identifying the cache-template element in the XMLkeyType - the type of keys for the CacheConfigurationBuilder to use, would need to
match the key-type declared in the template if declared in XMLvalueType - the type of values for the CacheConfigurationBuilder to use, would need to
match the value-type declared in the template if declared in XML
CacheConfigurationBuilder
or null if no cache-template for the provided name
java.lang.IllegalStateException - if parseConfiguration() hasn't yet been successfully invoked
java.lang.IllegalArgumentException - if keyType or valueType don't match the declared type(s) of the template
java.lang.ClassNotFoundException - if a Class declared in the XML couldn't be found
java.lang.InstantiationException - if a user provided Class couldn't get instantiated
java.lang.IllegalAccessException - if a method (including constructor) couldn't be invoked on a user provided typepublic java.util.Map<java.lang.String,CacheConfiguration<?,?>> getCacheConfigurations()
ConfigurationCacheConfiguration, used to create the named Cache
managed by a CacheManager
getCacheConfigurations in interface Configurationpublic java.util.Collection<ServiceCreationConfiguration<?>> getServiceCreationConfigurations()
ConfigurationCacheManager and
its Cache instances
getServiceCreationConfigurations in interface Configurationpublic java.lang.ClassLoader getClassLoader()
ConfigurationClassLoader to be associated with the CacheManager
getClassLoader in interface Configuration
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||