public class SingletonCacheFactoryBuilder extends ScopedCacheFactoryBuilder
CacheFactoryBuilder that maintains a single ConfigurableCacheFactory instance regardless of the requesting ClassLoader if a URI is not provided. This builder preserves behavior prior to Coherence 3.5.1.
As of Coherence 3.7, this implementation no longer provides various "validation strategies". The SingletonCacheFactoryBuilder is functionally equivalent to the pre 3.7 "compatibility" mode. For more advanced usage it is recommended to configure the ScopedCacheFactoryBuilder or, in rare cases, configure a custom ScopedCacheFactoryBuilder extension.
SessionProvider.Option| Modifier and Type | Field and Description |
|---|---|
protected ConfigurableCacheFactory |
m_ccfSingleton
Singleton
ConfigurableCacheFactory instance for the default URI. |
m_mapByLoader, m_mapConfigByLoader, m_scopeResolver, URI_DEFAULT| Constructor and Description |
|---|
SingletonCacheFactoryBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected ConfigurableCacheFactory |
getFactory(String sConfigURI, ClassLoader loader)
Helper method to return a
ConfigurableCacheFactory instance for the specified URI and class loader. |
protected ConfigurableCacheFactory |
getSingletonFactory()
Return the singleton cache factory.
|
void |
release(ConfigurableCacheFactory factory)
Release the specified ConfigurableCacheFactory.
|
void |
releaseAll(ClassLoader loader)
Release all ConfigurableCacheFactory objects for a given ClassLoader.
|
void |
setCacheConfiguration(String sConfigURI, ClassLoader loader, XmlElement xmlConfig)
Dynamically set the cache configuration for a given URI and class loader.
|
protected void |
setSingletonFactory(ConfigurableCacheFactory ccf)
Set the singleton cache factory (see
getSingletonFactory()). |
buildFactory, ensureConfigCCFMap, ensureConfigMap, getConfigurableCacheFactory, getConfigurableCacheFactory, getConfigurableCacheFactoryConfig, getScopeResolver, getXmlConfig, instantiateFactory, loadConfigFromURI, resolveURI, resolveURL, setCacheConfiguration, setConfigurableCacheFactory, setXmlConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateSessiongetprotected volatile ConfigurableCacheFactory m_ccfSingleton
ConfigurableCacheFactory instance for the default URI.protected ConfigurableCacheFactory getSingletonFactory()
protected void setSingletonFactory(ConfigurableCacheFactory ccf)
getSingletonFactory()).ccf - the singleton configurable cache factorypublic void setCacheConfiguration(String sConfigURI, ClassLoader loader, XmlElement xmlConfig)
setCacheConfiguration in interface CacheFactoryBuildersetCacheConfiguration in class ScopedCacheFactoryBuildersConfigURI - the configuration URI; must not be nullloader - class loader for which the configuration should be used; must not be nullxmlConfig - cache configuration in xml element formatpublic void releaseAll(ClassLoader loader)
releaseAll in interface CacheFactoryBuilderreleaseAll in class ScopedCacheFactoryBuilderloader - the class loader for which all associated cache factories should be releasedpublic void release(ConfigurableCacheFactory factory)
release in interface CacheFactoryBuilderrelease in class ScopedCacheFactoryBuilderfactory - the ConfigurableCacheFactory to releaseprotected ConfigurableCacheFactory getFactory(String sConfigURI, ClassLoader loader)
ConfigurableCacheFactory instance for the specified URI and class loader.getFactory in class ScopedCacheFactoryBuildersConfigURI - the configuration URI to return a ConfigurableCacheFactory forloader - the loader to return a CCF forConfigurableCacheFactory instance