Package com.tangosol.net
Class SingletonCacheFactoryBuilder
java.lang.Object
com.tangosol.net.ScopedCacheFactoryBuilder
com.tangosol.net.SingletonCacheFactoryBuilder
- All Implemented Interfaces:
CacheFactoryBuilder,SessionProvider,Comparable<SessionProvider>
Implementation of
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.
- Since:
- Coherence 3.5.1
- Author:
- rhl 2009.07.14, pp 2011.01.20
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.SessionProvider
SessionProvider.Context, SessionProvider.DefaultContext, SessionProvider.Option, SessionProvider.Provider, SessionProvider.Providers -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurableCacheFactorySingletonConfigurableCacheFactoryinstance for the default URI.Fields inherited from class com.tangosol.net.ScopedCacheFactoryBuilder
f_scopeResolver, m_mapByLoader, m_mapConfigByLoaderFields inherited from interface com.tangosol.net.CacheFactoryBuilder
URI_DEFAULTFields inherited from interface com.tangosol.net.SessionProvider
PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConfigurableCacheFactorygetFactory(String sConfigURI, ClassLoader loader, ParameterResolver resolver) Helper method to return aConfigurableCacheFactoryinstance for the specified URI and class loader.protected ConfigurableCacheFactoryReturn the singleton cache factory.voidrelease(ConfigurableCacheFactory factory) Release the specified ConfigurableCacheFactory.voidreleaseAll(ClassLoader loader) Release all ConfigurableCacheFactory objects for a given ClassLoader.voidsetCacheConfiguration(String sConfigURI, ClassLoader loader, XmlElement xmlConfig) Dynamically set the cache configuration for a given URI and class loader.protected voidSet the singleton cache factory (seegetSingletonFactory()).Methods inherited from class com.tangosol.net.ScopedCacheFactoryBuilder
buildFactory, buildFactory, ensureConfigCCFMap, ensureConfigMap, getConfigurableCacheFactory, getConfigurableCacheFactory, getConfigurableCacheFactory, getConfigurableCacheFactoryConfig, getScopeResolver, getXmlConfig, instantiateFactory, instantiateScopeResolver, loadConfigFromURI, resolveURI, resolveURL, setCacheConfiguration, setConfigurableCacheFactory, setXmlConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.net.CacheFactoryBuilder
createSession, releaseSessionMethods inherited from interface com.tangosol.net.SessionProvider
close, compareTo, createSession, createSession, createSession, createSession, getPriority
-
Field Details
-
m_ccfSingleton
SingletonConfigurableCacheFactoryinstance for the default URI.
-
-
Constructor Details
-
SingletonCacheFactoryBuilder
public SingletonCacheFactoryBuilder()
-
-
Method Details
-
getSingletonFactory
Return the singleton cache factory. A singleton cache factory is an unnamed configurable cache factory that does not depend on a class loader.- Returns:
- the singleton cache factory
-
setSingletonFactory
Set the singleton cache factory (seegetSingletonFactory()).- Parameters:
ccf- the singleton configurable cache factory
-
setCacheConfiguration
Dynamically set the cache configuration for a given URI and class loader. If a ConfigurableCacheFactory for the given URI and class loader already exists, the factory will be released.- Specified by:
setCacheConfigurationin interfaceCacheFactoryBuilder- Overrides:
setCacheConfigurationin classScopedCacheFactoryBuilder- Parameters:
sConfigURI- 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 format
-
releaseAll
Release all ConfigurableCacheFactory objects for a given ClassLoader.- Specified by:
releaseAllin interfaceCacheFactoryBuilder- Overrides:
releaseAllin classScopedCacheFactoryBuilder- Parameters:
loader- the class loader for which all associated cache factories should be released
-
release
Release the specified ConfigurableCacheFactory.- Specified by:
releasein interfaceCacheFactoryBuilder- Overrides:
releasein classScopedCacheFactoryBuilder- Parameters:
factory- the ConfigurableCacheFactory to release
-
getFactory
protected ConfigurableCacheFactory getFactory(String sConfigURI, ClassLoader loader, ParameterResolver resolver) Helper method to return aConfigurableCacheFactoryinstance for the specified URI and class loader.- Overrides:
getFactoryin classScopedCacheFactoryBuilder- Parameters:
sConfigURI- the configuration URI to return aConfigurableCacheFactoryforloader- the loader to return a CCF for- Returns:
- a
ConfigurableCacheFactoryinstance
-