|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.ScopedCacheFactoryBuilder
public class ScopedCacheFactoryBuilder
Implementation of CacheFactoryBuilder
that manages multiple instances of ConfigurableCacheFactory
. This implementation supports isolation of cache configurations via the following mechanisms:
ScopeResolver
. This will usually be done by containers that manage multiple applications that each use their own cache configuration.This scope name may be used by the ConfigurableCacheFactory
instance as a service name prefix.
Field Summary | |
---|---|
protected java.util.Map |
m_mapByLoader Mapping used to associate class loaders with the cache factories that are configured on them. |
protected java.util.Map |
m_mapInternedConfig Mapping of configuration resource URLs to the xml configuration elements loaded from those resources. |
protected ScopeResolver |
m_scopeResolver Scope resolver used to resolve scope name upon CCF construction |
protected static java.lang.String |
URI_DEFAULT Internally used "default" URI identifier. |
Constructor Summary | |
---|---|
ScopedCacheFactoryBuilder() Default constructor; reads scope resolver configuration from operational configuration file (tangosol-coherence.xml) |
|
ScopedCacheFactoryBuilder(ScopeResolver resolver) Constructor to provide a custom scope resolver |
Method Summary | |
---|---|
protected ConfigurableCacheFactory |
buildFactory(XmlElement xmlConfig, java.lang.ClassLoader loader) Construct a ConfigurableCacheFactory for the specified XML configuration. |
protected void |
configureScope(java.lang.String sConfigURI, java.lang.ClassLoader loader, XmlElement xmlConfig, ConfigurableCacheFactory ccf) For a given cache configuration URI and ClassLoader, configure the scope name for the associated ConfigurableCacheFactory . |
protected java.util.Map |
ensureConfigCCFMap(java.lang.ClassLoader loader) Ensure that a map from URI to ConfigurableCacheFactory for the specified loader exists (creating it if necessary). |
ConfigurableCacheFactory |
getConfigurableCacheFactory(java.lang.ClassLoader loader) Return the default ConfigurableCacheFactory for a given class loader. |
ConfigurableCacheFactory |
getConfigurableCacheFactory(java.lang.String sConfigURI, java.lang.ClassLoader loader) Return the ConfigurableCacheFactory for a given URI and class loader. |
protected ConfigurableCacheFactory |
getDefaultFactory(java.lang.ClassLoader loader) Return a default cache factory for the specified loader. |
protected ConfigurableCacheFactory |
getFactory(java.lang.String sConfigURI, java.lang.ClassLoader loader) Helper method to return a CCF instance for the specified URI and class loader. |
ScopeResolver |
getScopeResolver() Obtain the scope resolver for this builder |
protected XmlElement |
loadConfigFromURI(java.lang.String sConfigURI, java.lang.ClassLoader loader) Load the XML configuration from the specified URI. |
void |
release(ConfigurableCacheFactory factory) Release the specified ConfigurableCacheFactory. |
void |
releaseAll(java.lang.ClassLoader loader) Release all ConfigurableCacheFactory objects for a given ClassLoader. |
void |
setCacheConfiguration(java.lang.ClassLoader loader, XmlElement xmlConfig) Dynamically set the default cache configuration for a given class loader. |
void |
setCacheConfiguration(java.lang.String sConfigURI, java.lang.ClassLoader loader, XmlElement xmlConfig) Dynamically set the cache configuration for a given URI and class loader. |
void |
setScopeResolver(ScopeResolver scopeResolver) Specify the scope resolver for this builder |
Field Detail |
---|
protected ScopeResolver m_scopeResolver
protected java.util.Map m_mapByLoader
protected java.util.Map m_mapInternedConfig
Note: only xml configuration elements that are configured from a loaded resource are interned; externally configured cache factories are excluded.
protected static final java.lang.String URI_DEFAULT
Constructor Detail |
---|
public ScopedCacheFactoryBuilder()
public ScopedCacheFactoryBuilder(ScopeResolver resolver)
resolver
- scope resolverMethod Detail |
---|
public ScopeResolver getScopeResolver()
public void setScopeResolver(ScopeResolver scopeResolver)
scopeResolver
- scope resolverpublic ConfigurableCacheFactory getConfigurableCacheFactory(java.lang.ClassLoader loader)
getConfigurableCacheFactory
in interface CacheFactoryBuilder
loader
- class loader for which the configuration should be used; must not be nullpublic ConfigurableCacheFactory getConfigurableCacheFactory(java.lang.String sConfigURI, java.lang.ClassLoader loader)
getConfigurableCacheFactory
in interface CacheFactoryBuilder
sConfigURI
- the configuration URI; must not be nullloader
- class loader for which the configuration should be used; must not be nullpublic void setCacheConfiguration(java.lang.ClassLoader loader, XmlElement xmlConfig)
setCacheConfiguration
in interface CacheFactoryBuilder
loader
- class loader for which the configuration should be used; must not be nullxmlConfig
- cache configuration in xml element formatpublic void setCacheConfiguration(java.lang.String sConfigURI, java.lang.ClassLoader loader, XmlElement xmlConfig)
setCacheConfiguration
in interface CacheFactoryBuilder
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 formatpublic void releaseAll(java.lang.ClassLoader loader)
releaseAll
in interface CacheFactoryBuilder
loader
- the class loader for which all associated cache factories should be releasedpublic void release(ConfigurableCacheFactory factory)
release
in interface CacheFactoryBuilder
factory
- the ConfigurableCacheFactory to releaseprotected ConfigurableCacheFactory getFactory(java.lang.String sConfigURI, java.lang.ClassLoader loader)
sConfigURI
- the configuration URI to return a CCF forloader
- the loader to return a CCF forprotected java.util.Map ensureConfigCCFMap(java.lang.ClassLoader loader)
loader
- the class loader to which the map correspondsprotected ConfigurableCacheFactory getDefaultFactory(java.lang.ClassLoader loader)
loader
- the loader for which to create a default cache factoryprotected XmlElement loadConfigFromURI(java.lang.String sConfigURI, java.lang.ClassLoader loader)
sConfigURI
- the configuration URI; must not be nullloader
- class loader to useprotected ConfigurableCacheFactory buildFactory(XmlElement xmlConfig, java.lang.ClassLoader loader)
xmlConfig
- the XML configuration to create a factory forloader
- the class loader associated with the factoryprotected void configureScope(java.lang.String sConfigURI, java.lang.ClassLoader loader, XmlElement xmlConfig, ConfigurableCacheFactory ccf)
ConfigurableCacheFactory
.sConfigURI
- the configuration URI for the CCFloader
- the ClassLoader for the CCFxmlConfig
- XML configuration for the provided CCF; this may contain a scope nameccf
- the ConfigurableCacheFactory that will have its scope modified
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |