|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.net.DefaultConfigurableCacheFactory
public class DefaultConfigurableCacheFactory
DefaultConfigurableCacheFactory provides a facility to access caches declared in a "cache-config.dtd" compliant configuration file.
This class is designed to be easily extendable with a collection of factory methods allowing subclasses to customize it by overriding any subset of cache instantiation routines or even allowing addition of custom schemes.
There are various ways of using this factory:
ConfigurableCacheFactory factory = new DefaultConfigurableCacheFactory(sPath); ... ClassLoader loader = getClass().getClassLoader(); NamedCache cacheOne = factory.ensureCache("one", loader); NamedCache cacheTwo = factory.ensureCache("two", loader);Using this approach allows an easy customization by extending the DefaultConfigurableCacheFactory and changing the instantiation line:
ConfigurableCacheFactory factory = new CustomConfigurableCacheFactory(); ...Another option is using the static version of the "ensureCache" call:
ClassLoader loader = getClass().getClassLoader(); NamedCache cacheOne = CacheFactory.getCache("one", loader); NamedCache cacheTwo = CacheFactory.getCache("two", loader);which uses an instance of ConfigurableCacheFactory obtained by
CacheFactory.getConfigurableCacheFactory()
.
CacheFactory.getCache(String, ClassLoader)
Nested Class Summary | |
---|---|
static class |
DefaultConfigurableCacheFactory.CacheInfo
CacheInfo is a placeholder for cache attributes retrieved during parsing the corresponding cache mapping element. |
class |
DefaultConfigurableCacheFactory.Manager
BackingMapManager implementation that uses the configuration XML to create the required backing maps and provides client access to those maps. |
Field Summary | |
---|---|
static String |
CACHE_NAME
The name of the replaceable parameter representing the cache name. |
static String |
CLASS_LOADER
The name of the replaceable parameter representing the class loader. |
static String |
FILE_CFG_CACHE
The default configuration file name. |
protected ConcurrentMap |
m_mapByName
Map keyed by a cache name with a corresponding value being a map keyed by a class loader with a corresponding value being a NamedCache reference. |
static String |
MGR_CONTEXT
The name of the replaceable parameter representing the backing map manager context. |
static int |
SCHEME_CLASS
The custom class scheme. |
static int |
SCHEME_DISK
Deprecated. As of Coherence 3.0, replaced by SCHEME_EXTERNAL
and SCHEME_EXTERNAL_PAGED |
static int |
SCHEME_DISTRIBUTED
The distributed cache scheme. |
static int |
SCHEME_EXTERNAL
The external scheme. |
static int |
SCHEME_EXTERNAL_PAGED
The paged-external scheme. |
static int |
SCHEME_INVOCATION
The invocation service scheme. |
static int |
SCHEME_LOCAL
The local cache scheme. |
static int |
SCHEME_NEAR
The near cache scheme. |
static int |
SCHEME_OPTIMISTIC
The optimistic cache scheme. |
static int |
SCHEME_OVERFLOW
The overflow map scheme. |
static int |
SCHEME_PROXY
The proxy service scheme. |
static int |
SCHEME_READ_WRITE_BACKING
The read write backing map scheme. |
static String |
SCHEME_REF
The name of the replaceable parameter representing the scheme reference. |
static int |
SCHEME_REMOTE_CACHE
The remote cache scheme. |
static int |
SCHEME_REMOTE_INVOCATION
The remote invocation scheme. |
static int |
SCHEME_REPLICATED
The replicated cache scheme. |
static int |
SCHEME_UNKNOWN
The unknwown scheme type. |
static int |
SCHEME_VERSIONED_BACKING
The versioned backing map scheme. |
static int |
SCHEME_VERSIONED_NEAR
The versioned near cache scheme. |
Constructor Summary | |
---|---|
DefaultConfigurableCacheFactory()
Construct a default DefaultConfigurableCacheFactory using the default configuration file name. |
|
DefaultConfigurableCacheFactory(String sPath)
Construct a DefaultConfigurableCacheFactory using the specified path to a "cache-config.dtd" compliant configuration file or resource. |
|
DefaultConfigurableCacheFactory(String sPath,
ClassLoader loader)
Construct a DefaultConfigurableCacheFactory using the specified path to a "cache-config.dtd" compliant configuration file or resource. |
|
DefaultConfigurableCacheFactory(XmlElement xmlConfig)
Construct a DefaultConfigurableCacheFactory using the specified configuration XML. |
Method Summary | |
---|---|
Map |
configureBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlScheme,
BackingMapManagerContext context,
ClassLoader loader,
Map mapListeners)
Configures a backing map according to the scheme. |
protected NamedCache |
configureCache(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlScheme,
ClassLoader loader)
Ensures a cache for given scheme. |
protected NamedCache |
ensureCache(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlScheme,
ClassLoader loader)
Obtain the NamedCache reference for the cache service defined by the specified scheme. |
NamedCache |
ensureCache(String sCacheName,
ClassLoader loader)
Ensure a cache for the given name using the corresponding XML configuration. |
Service |
ensureService(String sServiceName)
Ensure a service for the given name using the corresponding XML configuration. |
Service |
ensureService(XmlElement xmlScheme)
Ensure the service for the specified scheme. |
protected XmlElement |
findScheme(String sSchemeName)
In the configuration XML find a "scheme" element associated with a given cache name. |
DefaultConfigurableCacheFactory.CacheInfo |
findSchemeMapping(String sCacheName)
In the configuration XML find a "cache-mapping" element associated with a given cache name. |
protected XmlElement |
findServiceScheme(String sServiceName)
In the configuration XML find a "scheme" element associated with a given service name. |
XmlElement |
getConfig()
Obtain the factory configuration XML. |
protected void |
initializeBundler(AbstractBundler bundler,
XmlElement xmlBundle)
Initialize the specified bundler using the "bundle-config" element. |
protected Object |
instantiateAny(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlClass,
BackingMapManagerContext context,
ClassLoader loader)
Create an Object using "class-scheme" element. |
protected AsyncBinaryStore |
instantiateAsyncBinaryStore(BinaryStore store,
int cbMaxAsync)
Construct an AsyncBinaryStore using the specified parameters. |
protected AsyncBinaryStoreManager |
instantiateAsyncBinaryStoreManager(BinaryStoreManager storeMgr,
int cbMaxAsync)
Construct an AsyncBinaryStoreManager using the specified parameters. |
protected BinaryStoreManager |
instantiateBinaryStoreManager(XmlElement xmlConfig,
ClassLoader loader,
boolean fPaged)
Create a BinaryStoreManager using the specified XML configuration. |
protected BundlingNamedCache |
instantiateBundlingNamedCache(NamedCache cache,
XmlElement xmlBundling)
Create a BundlingNamedCache using the "operation-bundling" element. |
protected CacheLoader |
instantiateCacheStore(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlStore,
BackingMapManagerContext context,
ClassLoader loader)
Create a CacheLoader or CacheStore using the "cachestore-scheme" element. |
protected Map |
instantiateDiskBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlDisk,
BackingMapManagerContext context,
ClassLoader loader)
Deprecated. As of Coherence 3.0, replaced by instantiateExternalBackingMap(com.tangosol.net.DefaultConfigurableCacheFactory.CacheInfo, com.tangosol.run.xml.XmlElement, com.tangosol.net.BackingMapManagerContext, java.lang.ClassLoader) and
instantiatePagedExternalBackingMap(com.tangosol.net.DefaultConfigurableCacheFactory.CacheInfo, com.tangosol.run.xml.XmlElement, com.tangosol.net.BackingMapManagerContext, java.lang.ClassLoader) |
protected Map |
instantiateExternalBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlExternal,
BackingMapManagerContext context,
ClassLoader loader)
Create a backing Map using the "external-scheme" element. |
protected Map |
instantiateLocalCache(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlLocal,
ClassLoader loader)
Create a backing Map using the "local-scheme" element. |
protected LocalCache |
instantiateLocalCache(int cUnits,
int cExpiryMillis)
Construct a LocalCache using the specified parameters. |
protected Map |
instantiateMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlClass,
BackingMapManagerContext context,
ClassLoader loader)
Create a backing Map using the "class-scheme" element. |
protected MapListener |
instantiateMapListener(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlClass,
BackingMapManagerContext context,
ClassLoader loader)
Create a MapListener using the using the "class-scheme" element. |
protected NearCache |
instantiateNearCache(Map mapFront,
NamedCache mapBack,
int nStrategy)
Construct an NearCache using the specified parameters. |
protected Map |
instantiateOverflowBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlOverflow,
BackingMapManagerContext context,
ClassLoader loader,
Map mapListeners)
Create a backing Map using the "overflow-scheme" element. |
protected OverflowMap |
instantiateOverflowMap(ObservableMap mapFront,
Map mapBack,
boolean fExpiry)
Construct an OverflowMap using the specified parameters. |
protected Map |
instantiatePagedExternalBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlPaged,
BackingMapManagerContext context,
ClassLoader loader)
Create a backing Map using the "paged-external-scheme" element. |
protected ReadWriteBackingMap |
instantiateReadWriteBackingMap(BackingMapManagerContext context,
ObservableMap mapInternal,
Map mapMisses,
CacheLoader loader)
Construct a ReadWriteBackingMap using the specified parameters. |
protected ReadWriteBackingMap |
instantiateReadWriteBackingMap(BackingMapManagerContext context,
ObservableMap mapInternal,
Map mapMisses,
CacheStore store,
boolean fReadOnly,
int cWriteBehindSeconds,
double dflRefreshAheadFactor)
Construct a ReadWriteBackingMap using the specified parameters. |
protected Map |
instantiateReadWriteBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlRWBM,
BackingMapManagerContext context,
Map mapListeners)
Create a ReadWriteBackingMap using the "read-write-backing-map-scheme" element. |
protected SerializationCache |
instantiateSerializationCache(BinaryStore store,
int cMax,
boolean fBinaryMap)
Construct an SerializationCache using the specified parameters. |
protected SerializationCache |
instantiateSerializationCache(BinaryStore store,
int cMax,
ClassLoader loader)
Construct an SerializationCache using the specified parameters. |
protected SerializationMap |
instantiateSerializationMap(BinaryStore store,
boolean fBinaryMap)
Construct an SerializationMap using the specified parameters. |
protected Map |
instantiateSerializationMap(BinaryStore store,
boolean fBinaryMap,
ClassLoader loader,
int cHighUnits,
int cExpiryMillis,
String sSubclass,
XmlElement xmlInitParams)
Instantiate a SerializationMap, SerializationCache, SimpleSerializationMap, or any sub-class thereof. |
protected SerializationMap |
instantiateSerializationMap(BinaryStore store,
ClassLoader loader)
Construct an SerializationMap using the specified parameters. |
protected SerializationPagedCache |
instantiateSerializationPagedCache(BinaryStoreManager storeMgr,
int cPages,
int cPageSecs,
boolean fBinaryMap,
boolean fPassive)
Construct an SerializationPagedCache using the specified parameters. |
protected SerializationPagedCache |
instantiateSerializationPagedCache(BinaryStoreManager storeMgr,
int cPages,
int cPageSecs,
ClassLoader loader)
Construct an SerializationPagedCache using the specified parameters. |
protected SimpleOverflowMap |
instantiateSimpleOverflowMap(ObservableMap mapFront,
Map mapBack,
Map mapMisses)
Construct a SimpleOverflowMap using the specified parameters. |
protected Object |
instantiateSubclass(String sClass,
Class clzSuper,
ClassLoader loader,
Object[] aoParam,
XmlElement xmlParams)
Construct an instance of the specified class using the specified parameters. |
protected VersionedBackingMap |
instantiateVersionedBackingMap(BackingMapManagerContext context,
ObservableMap mapInternal,
Map mapMisses,
CacheLoader loader,
NamedCache mapVersionTransient,
NamedCache mapVersionPersist,
boolean fManageTransient)
Construct a VersionedBackingMap using the specified parameters. |
protected VersionedBackingMap |
instantiateVersionedBackingMap(BackingMapManagerContext context,
ObservableMap mapInternal,
Map mapMisses,
CacheStore store,
boolean fReadOnly,
int cWriteBehindSeconds,
double dflRefreshAheadFactor,
NamedCache mapVersionTransient,
NamedCache mapVersionPersist,
boolean fManageTransient)
Construct a VersionedBackingMap using the specified parameters. |
protected Map |
instantiateVersionedBackingMap(DefaultConfigurableCacheFactory.CacheInfo info,
XmlElement xmlVBM,
BackingMapManagerContext context,
Map mapListeners)
Create a VersionedBackingMap using the "versioned-backing-map-scheme" element. |
protected VersionedNearCache |
instantiateVersionedNearCache(Map mapLocal,
NamedCache mapDist,
NamedCache mapVersion)
Construct an VersionedNearCache using the specified parameters. |
static boolean |
isPutAllOptimized(Map map)
Determines whether or not the specified Map is optimized for a putAll() operation versus a regular
put() operation. |
static XmlDocument |
loadConfig(String sName)
Load the configuration from a file or resource. |
static XmlDocument |
loadConfig(String sName,
ClassLoader loader)
Load the configuration from a file or resource. |
static XmlDocument |
loadConfigAsResource(String sResource,
ClassLoader loader)
Load the configuration as a resource. |
static XmlDocument |
loadConfigFromFile(File file)
Load the configuration from a file or directory. |
protected String |
popCacheContext()
Pop cache context from a thread-local storage. |
protected void |
pushCacheContext(String sContext)
Push cache context into a thread-local storage. |
protected void |
register(CacheService service,
String sCacheName,
String sContext,
Map map)
Register the specified cache with the cluster registry. |
protected void |
register(NamedCache cache,
String sContext)
Register the specified NamedCache with the cluster registry. |
protected void |
release(BinaryStore store)
Release all resources assosiated with the specified binary store. |
protected void |
release(CacheLoader loader)
Release all resources assosiated with the specified loader. |
void |
release(Map map,
Map mapListeners)
Release all resources assosiated with the specified backing map. |
XmlElement |
resolveScheme(DefaultConfigurableCacheFactory.CacheInfo info)
In the configuration XML find a "scheme" element associated with a given cache and resolve it (recursively) using the "scheme-ref" elements. |
protected XmlElement |
resolveScheme(XmlElement xmlScheme,
DefaultConfigurableCacheFactory.CacheInfo info,
boolean fChild,
boolean fRequired)
Resolve the specified "XYZ-scheme" by retrieving the base element refered to by the "scheme-ref" element, resolving it recursively, and combining it with the specified overrides and cache specific attributes. |
void |
setConfig(XmlElement xmlConfig)
Specify the factory configuration XML. |
int |
translateSchemeType(String sScheme)
Translate the scheme name into the scheme type. |
protected void |
unregister(CacheService service,
String sCacheName)
Unregister all the managed objects theat belong to the specified cache from the cluster registry. |
protected void |
unregister(String sCacheName,
String sContext)
Unregister the caches for a given cache name and context from the cluster registry. |
protected void |
verifyMapListener(DefaultConfigurableCacheFactory.CacheInfo info,
Map map,
XmlElement xmlScheme,
BackingMapManagerContext context,
ClassLoader loader,
Map mapListeners)
Check whether or not a MapListener has to be instantiated and added to a Map according to a scheme definition. |
Field Detail |
---|
public static final String FILE_CFG_CACHE
public static final String CACHE_NAME
public static final String CLASS_LOADER
public static final String MGR_CONTEXT
public static final String SCHEME_REF
public static final int SCHEME_UNKNOWN
public static final int SCHEME_REPLICATED
public static final int SCHEME_OPTIMISTIC
public static final int SCHEME_DISTRIBUTED
public static final int SCHEME_NEAR
public static final int SCHEME_VERSIONED_NEAR
public static final int SCHEME_LOCAL
public static final int SCHEME_OVERFLOW
public static final int SCHEME_DISK
SCHEME_EXTERNAL
and SCHEME_EXTERNAL_PAGED
public static final int SCHEME_EXTERNAL
public static final int SCHEME_EXTERNAL_PAGED
public static final int SCHEME_CLASS
public static final int SCHEME_READ_WRITE_BACKING
public static final int SCHEME_VERSIONED_BACKING
public static final int SCHEME_INVOCATION
public static final int SCHEME_PROXY
public static final int SCHEME_REMOTE_CACHE
public static final int SCHEME_REMOTE_INVOCATION
protected ConcurrentMap m_mapByName
Constructor Detail |
---|
public DefaultConfigurableCacheFactory()
public DefaultConfigurableCacheFactory(String sPath)
sPath
- the configuration resource name or file pathpublic DefaultConfigurableCacheFactory(String sPath, ClassLoader loader)
sPath
- the configuration resource name or file pathloader
- (optional) ClassLoader that should be used to load the
configration resourcepublic DefaultConfigurableCacheFactory(XmlElement xmlConfig)
xmlConfig
- the configuration XmlElementMethod Detail |
---|
public XmlElement getConfig()
getConfig
in interface ConfigurableCacheFactory
getConfig
in interface XmlConfigurable
public void setConfig(XmlElement xmlConfig)
setConfig
in interface ConfigurableCacheFactory
setConfig
in interface XmlConfigurable
xmlConfig
- the configuration XMLpublic NamedCache ensureCache(String sCacheName, ClassLoader loader)
ensureCache
in interface ConfigurableCacheFactory
sCacheName
- the cache nameloader
- ClassLoader that should be used to deserialize
objects in the cache
public Service ensureService(String sServiceName)
ensureService
in interface ConfigurableCacheFactory
sServiceName
- the service name
public static XmlDocument loadConfig(String sName)
sName
- the name of file or resource.
public static XmlDocument loadConfig(String sName, ClassLoader loader)
sName
- the name of file or resource.loader
- (optional) ClassLoader that should be used to load the
configration resource
public static XmlDocument loadConfigAsResource(String sResource, ClassLoader loader)
sResource
- the resource nameloader
- (optional) ClassLoader that should be used to load the
configration resource
public static XmlDocument loadConfigFromFile(File file)
file
- file or directory to load the configuration from
public DefaultConfigurableCacheFactory.CacheInfo findSchemeMapping(String sCacheName)
sCacheName
- the value of the "cache-name" element to look for
public XmlElement resolveScheme(DefaultConfigurableCacheFactory.CacheInfo info)
info
- the cache info
protected XmlElement findScheme(String sSchemeName)
sSchemeName
- the value of the "cache-name" element to look for
protected XmlElement findServiceScheme(String sServiceName)
sServiceName
- the value of the "service-name" element to look for
protected XmlElement resolveScheme(XmlElement xmlScheme, DefaultConfigurableCacheFactory.CacheInfo info, boolean fChild, boolean fRequired)
xmlScheme
- a scheme element to resolveinfo
- the cache info (optional)fChild
- if true, the actual cache scheme is the only "xyz-scheme"
child of the specified xmlScheme element;
otherwise it's the xmlScheme element itselffRequired
- if true, the child scheme must be present; false otherwise
protected NamedCache ensureCache(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlScheme, ClassLoader loader)
info
- the cache infoxmlScheme
- the scheme element for the cacheloader
- (optional) ClassLoader that should be used to
deserialize objects in the cache
public Service ensureService(XmlElement xmlScheme)
xmlScheme
- the scheme
protected NamedCache configureCache(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlScheme, ClassLoader loader)
info
- the cache infoxmlScheme
- the corresponding schemeloader
- ClassLoader that should be used to deserialize
objects in the cache
protected NearCache instantiateNearCache(Map mapFront, NamedCache mapBack, int nStrategy)
This method exposes a corresponding NearCache
constructor
and is provided for the express purpose of allowing its override.
protected VersionedNearCache instantiateVersionedNearCache(Map mapLocal, NamedCache mapDist, NamedCache mapVersion)
This method exposes a corresponding VersionedNearCache
constructor
and is provided for the express purpose of allowing its override.
public Map configureBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlScheme, BackingMapManagerContext context, ClassLoader loader, Map mapListeners)
info
- the cache infoxmlScheme
- the scheme element for cache configurationcontext
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classesmapListeners
- map of registered map listeners keyed by the
corresponding map identities
protected void verifyMapListener(DefaultConfigurableCacheFactory.CacheInfo info, Map map, XmlElement xmlScheme, BackingMapManagerContext context, ClassLoader loader, Map mapListeners)
info
- the cache infomap
- an ObservableMap to add a listener toxmlScheme
- the corresponding schemecontext
- BackingMapManagerContext to be usedloader
- ClassLoader that should be used to instantiate
a MapListener objectmapListeners
- map of registered map listeners keyed by the
corresponding map identities
IllegalArgumentException
- if the listener is required, but the
map does not implement ObservableMap interface or if the
listener cannot be instanitatedprotected Map instantiateReadWriteBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlRWBM, BackingMapManagerContext context, Map mapListeners)
info
- the cache infoxmlRWBM
- "read-write-backing-map-scheme" element.context
- BackingMapManagerContext to be usedmapListeners
- map of registered map listeners keyed by the
corresponding map identities
protected ReadWriteBackingMap instantiateReadWriteBackingMap(BackingMapManagerContext context, ObservableMap mapInternal, Map mapMisses, CacheStore store, boolean fReadOnly, int cWriteBehindSeconds, double dflRefreshAheadFactor)
This method exposes a corresponding ReadWriteBackingMap
constructor
and is provided for the express purpose of allowing its override.
protected ReadWriteBackingMap instantiateReadWriteBackingMap(BackingMapManagerContext context, ObservableMap mapInternal, Map mapMisses, CacheLoader loader)
This method exposes a corresponding ReadWriteBackingMap
constructor
and is provided for the express purpose of allowing its override.
protected Map instantiateVersionedBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlVBM, BackingMapManagerContext context, Map mapListeners)
info
- the cache infoxmlVBM
- "versioned-backing-map-scheme" element.context
- BackingMapManagerContext to be usedmapListeners
- map of registered map listeners keyed by the
corresponding map identities
protected VersionedBackingMap instantiateVersionedBackingMap(BackingMapManagerContext context, ObservableMap mapInternal, Map mapMisses, CacheStore store, boolean fReadOnly, int cWriteBehindSeconds, double dflRefreshAheadFactor, NamedCache mapVersionTransient, NamedCache mapVersionPersist, boolean fManageTransient)
This method exposes a corresponding VersionedBackingMap
constructor
and is provided for the express purpose of allowing its override.
protected VersionedBackingMap instantiateVersionedBackingMap(BackingMapManagerContext context, ObservableMap mapInternal, Map mapMisses, CacheLoader loader, NamedCache mapVersionTransient, NamedCache mapVersionPersist, boolean fManageTransient)
This method exposes a corresponding VersionedBackingMap
constructor
and is provided for the express purpose of allowing its override.
protected Map instantiateLocalCache(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlLocal, ClassLoader loader)
info
- the cache infoxmlLocal
- "local-scheme" element.loader
- the ClassLoader to instantiate necessary classes
protected LocalCache instantiateLocalCache(int cUnits, int cExpiryMillis)
This method exposes a corresponding LocalCache
constructor
and is provided for the express purpose of allowing its override.
protected Map instantiateOverflowBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlOverflow, BackingMapManagerContext context, ClassLoader loader, Map mapListeners)
info
- the cache infoxmlOverflow
- "overflow-scheme" element.context
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classesmapListeners
- map of registered map listeners keyed by the
corresponding map identities
protected OverflowMap instantiateOverflowMap(ObservableMap mapFront, Map mapBack, boolean fExpiry)
This method exposes a corresponding OverflowMap
constructor
and is provided for the express purpose of allowing its override.
protected SimpleOverflowMap instantiateSimpleOverflowMap(ObservableMap mapFront, Map mapBack, Map mapMisses)
This method exposes a corresponding SimpleOverflowMap
constructor
and is provided for the express purpose of allowing its override.
protected Map instantiateDiskBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlDisk, BackingMapManagerContext context, ClassLoader loader)
instantiateExternalBackingMap(com.tangosol.net.DefaultConfigurableCacheFactory.CacheInfo, com.tangosol.run.xml.XmlElement, com.tangosol.net.BackingMapManagerContext, java.lang.ClassLoader)
and
instantiatePagedExternalBackingMap(com.tangosol.net.DefaultConfigurableCacheFactory.CacheInfo, com.tangosol.run.xml.XmlElement, com.tangosol.net.BackingMapManagerContext, java.lang.ClassLoader)
info
- the cache infoxmlDisk
- "disk-scheme" element.context
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classes
protected Map instantiateSerializationMap(BinaryStore store, boolean fBinaryMap, ClassLoader loader, int cHighUnits, int cExpiryMillis, String sSubclass, XmlElement xmlInitParams)
store
- a BinaryStore to use to write serialized data tofBinaryMap
- true if the only data written to the Map will
already be in Binary formloader
- the ClassLoader to use (if not a Binary map)cHighUnits
- the max size in units for the serialization cachecExpiryMillis
- the expiry time in milliseconds for the cachesSubclass
- the sub-class name (or "")xmlInitParams
- the init params for the sub-class
protected Map instantiateExternalBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlExternal, BackingMapManagerContext context, ClassLoader loader)
info
- the cache infoxmlExternal
- "external-scheme" element.context
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classes
protected Map instantiatePagedExternalBackingMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlPaged, BackingMapManagerContext context, ClassLoader loader)
info
- the cache infoxmlPaged
- "paged-external-scheme" element.context
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classes
protected BinaryStoreManager instantiateBinaryStoreManager(XmlElement xmlConfig, ClassLoader loader, boolean fPaged)
xmlConfig
- the XmlElement that contains the configuration info for
the BinaryStoreManager that will be instantiatedloader
- the ClassLoader to instantiate necessary classesfPaged
- flag indicating whether or not the returned
BinaryStoreManager will be used by a
SerializationPagedCache
protected AsyncBinaryStore instantiateAsyncBinaryStore(BinaryStore store, int cbMaxAsync)
store
- the BinaryStore to make asynchronouscbMaxAsync
- the maximum amount of "async writes" data that will
be queued
protected AsyncBinaryStoreManager instantiateAsyncBinaryStoreManager(BinaryStoreManager storeMgr, int cbMaxAsync)
storeMgr
- the BinaryStoreManager to make asynchronouscbMaxAsync
- the maximum amount of "async writes" data that will
be queued
protected SerializationPagedCache instantiateSerializationPagedCache(BinaryStoreManager storeMgr, int cPages, int cPageSecs, ClassLoader loader)
This method exposes a corresponding SerializationPagedCache
constructor
and is provided for the express purpose of allowing its override.
protected SerializationPagedCache instantiateSerializationPagedCache(BinaryStoreManager storeMgr, int cPages, int cPageSecs, boolean fBinaryMap, boolean fPassive)
This method exposes a corresponding SerializationPagedCache
constructor
and is provided for the express purpose of allowing its override.
protected SerializationCache instantiateSerializationCache(BinaryStore store, int cMax, ClassLoader loader)
This method exposes a corresponding SerializationCache
constructor
and is provided for the express purpose of allowing its override.
protected SerializationCache instantiateSerializationCache(BinaryStore store, int cMax, boolean fBinaryMap)
This method exposes a corresponding SerializationCache
constructor
and is provided for the express purpose of allowing its override.
protected SerializationMap instantiateSerializationMap(BinaryStore store, ClassLoader loader)
This method exposes a corresponding SerializationMap
constructor
and is provided for the express purpose of allowing its override.
protected SerializationMap instantiateSerializationMap(BinaryStore store, boolean fBinaryMap)
This method exposes a corresponding SerializationMap
constructor
and is provided for the express purpose of allowing its override.
protected BundlingNamedCache instantiateBundlingNamedCache(NamedCache cache, XmlElement xmlBundling)
cache
- the wrapped cachexmlBundling
- the "operation-bundling" element
protected void initializeBundler(AbstractBundler bundler, XmlElement xmlBundle)
bundler
- the bundlerxmlBundle
- a "bundle-config" elementprotected Map instantiateMap(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlClass, BackingMapManagerContext context, ClassLoader loader)
instantiateAny
.
info
- the cache infoxmlClass
- "class-scheme" elementcontext
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classes
protected CacheLoader instantiateCacheStore(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlStore, BackingMapManagerContext context, ClassLoader loader)
info
- the cache infoxmlStore
- "cachestore-scheme" element for the store or loaderloader
- the ClassLoader to instantiate necessary classes
protected MapListener instantiateMapListener(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlClass, BackingMapManagerContext context, ClassLoader loader)
info
- the cache infoxmlClass
- "class-scheme" elementcontext
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classesprotected Object instantiateAny(DefaultConfigurableCacheFactory.CacheInfo info, XmlElement xmlClass, BackingMapManagerContext context, ClassLoader loader)
If the value of any "param-value" element contains the literal
"{cache-name}", replace it with the actual cache name.
If the value of "param-value" element is "{class-loader}"
and "param-type" element is "java.lang.ClassLoader" replace it
with the current ClassLoader object.
If the value of "param-value" element is "{manager-context}"
and "param-type" element is "com.tangosol.net.BackingMapManagerContext"
replace it with the current BackingMapManagerContext object.
Finally, if the value of "param-type" is "{scheme-ref}" then the
"param-value" should be a name of the scheme that will be used in place
of the value.
info
- the cache infoxmlClass
- "class-scheme" element.context
- BackingMapManagerContext to be usedloader
- the ClassLoader to instantiate necessary classes
protected Object instantiateSubclass(String sClass, Class clzSuper, ClassLoader loader, Object[] aoParam, XmlElement xmlParams)
sClass
- the class nameclzSuper
- the super class of the newly instantiated classloader
- the ClassLoader to instantiate necessary classesaoParam
- the constructor paramtersxmlParams
- the "init-params" XmlElement (optional)
public void release(Map map, Map mapListeners)
map
- the map being releasedmapListeners
- map of registered map listeners keyed by the
corresponding map identitiesprotected void release(CacheLoader loader)
loader
- the cache loader being releasedprotected void release(BinaryStore store)
store
- the binary store being releasedpublic int translateSchemeType(String sScheme)
sScheme
- the scheme name
public static boolean isPutAllOptimized(Map map)
putAll()
operation versus a regular
put()
operation.
map
- a Map instance to check
protected void register(NamedCache cache, String sContext)
cache
- the NamedCache object to registersContext
- the cache context (tier)protected void register(CacheService service, String sCacheName, String sContext, Map map)
service
- the CacheService that the cache belongs tosCacheName
- the cache namesContext
- the cache context (tier)map
- the cache object to registerprotected void unregister(CacheService service, String sCacheName)
service
- the CacheService that the cache belongs tosCacheName
- the cache nameprotected void unregister(String sCacheName, String sContext)
sCacheName
- the cache namesContext
- the cache context (tier)protected void pushCacheContext(String sContext)
sContext
- cache context (tag)protected String popCacheContext()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |