Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net
Class DefaultCacheFactoryBuilder

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.ScopedCacheFactoryBuilder
          extended by com.tangosol.net.DefaultCacheFactoryBuilder

All Implemented Interfaces:
CacheFactoryBuilder

public class DefaultCacheFactoryBuilder
extends ScopedCacheFactoryBuilder

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 DefaultCacheFactoryBuilder is functionally equivalent to the pre 3.7 "compatibility" mode. For more advanced usage it is recommended to configure the ScopedCacheFactoryBuilder with a custom ScopeResolver or, in rare cases, configure a custom ScopedCacheFactoryBuilder extension.

Since:
Coherence 3.5.1
Author:
rhl 2009.07.14, pp 2011.01.20

Field Summary
protected  ConfigurableCacheFactory m_ccfSingleton
          Singleton ConfigurableCacheFactory instance for the default URI.

 

Fields inherited from class com.tangosol.net.ScopedCacheFactoryBuilder
m_mapByLoader, m_mapInternedConfig, m_scopeResolver, URI_DEFAULT

 

Constructor Summary
DefaultCacheFactoryBuilder()
           

 

Method Summary
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.
protected  ConfigurableCacheFactory getSingletonFactory()
          Return the singleton cache factory.
 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.String sConfigURI, java.lang.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()).

 

Methods inherited from class com.tangosol.net.ScopedCacheFactoryBuilder
buildFactory, configureScope, ensureConfigCCFMap, getConfigurableCacheFactory, getConfigurableCacheFactory, getDefaultFactory, getScopeResolver, loadConfigFromURI, setCacheConfiguration, setScopeResolver

 

Field Detail

m_ccfSingleton

protected volatile ConfigurableCacheFactory m_ccfSingleton
Singleton ConfigurableCacheFactory instance for the default URI.

Constructor Detail

DefaultCacheFactoryBuilder

public DefaultCacheFactoryBuilder()

Method Detail

getSingletonFactory

protected ConfigurableCacheFactory 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

protected void setSingletonFactory(ConfigurableCacheFactory ccf)
Set the singleton cache factory (see getSingletonFactory()).
Parameters:
ccf - the singleton configurable cache factory

setCacheConfiguration

public void setCacheConfiguration(java.lang.String sConfigURI,
                                  java.lang.ClassLoader loader,
                                  XmlElement xmlConfig)
Dynamically set the cache configuration for a given URI and class loader.
Specified by:
setCacheConfiguration in interface CacheFactoryBuilder
Overrides:
setCacheConfiguration in class ScopedCacheFactoryBuilder
Parameters:
sConfigURI - the configuration URI; must not be null
loader - class loader for which the configuration should be used; must not be null
xmlConfig - cache configuration in xml element format

releaseAll

public void releaseAll(java.lang.ClassLoader loader)
Release all ConfigurableCacheFactory objects for a given ClassLoader.
Specified by:
releaseAll in interface CacheFactoryBuilder
Overrides:
releaseAll in class ScopedCacheFactoryBuilder
Parameters:
loader - the class loader for which all associated cache factories should be released

release

public void release(ConfigurableCacheFactory factory)
Release the specified ConfigurableCacheFactory.
Specified by:
release in interface CacheFactoryBuilder
Overrides:
release in class ScopedCacheFactoryBuilder
Parameters:
factory - the ConfigurableCacheFactory to release

getFactory

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.
Overrides:
getFactory in class ScopedCacheFactoryBuilder
Parameters:
sConfigURI - the configuration URI to return a CCF for
loader - the loader to return a CCF for
Returns:
a CCF instance

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.