Each Cache implementation returned by this CacheProvider delegates most operations to a Coherence NamedCache configured via the XML cache configuration descriptor with URI PATH_CACHE_CONFIG. The name of the delegate NamedCache is constructed by appending the value returned by the getScopeIdentifier() method to the Cache name. For example, a Cache named "portalControlTreeCache" used within the "portalApp" J2EE application would delegate to the "portalControlTreeCache:portalApp" NamedCache.

If a serialization error occurs while updating a cached value, the Cache implementation will store the updated value in a LocalCache and log an error message (once per non-serializable class). In this case, the configuration of the Cache should be changed to a LocalCache.

The CacheProvider is configured via the XML configuration file loaded using the PATH_PROVIDER_CONFIG resource URI. This file contains configuration for the following PortalCacheProvider properties:

Either true or false to indicate whether the PortalCacheProvider should shutdown the Coherence cluster when it is shutdown. For example, this should be set to true if coherence.jar and coherence-wlp.jar are deployed within the portal application.

Either true or false to indicate whether the Cache implementations returned by the PortalCacheProvider should return a fully realized set of cached values from the entrySet() method, rather than a virtual collection of cached values. The Cache API specifies that the entrySet() method should return the set of cached values. Not only is this quite unconventional (see the JavaDoc for the java.util.Map#entrySet method), but it can be a CPU- and memory-intensive operation; therefore, it is recommended that this elment be set to false unless strict compatibility with the default P13N CacheProvider is required.

Either true or false to indiciate whether the PortalCacheProvider should return Cache implementations that support the ReloadableCache API. Supporting the ReloadableCache API requires additional resources; therefore, if Cache reloading is not needed, it is recommended that this element be set to false.

Note: Use of the PortalCacheProvider requires WebLogic Portal 8.1.6 or higher. Additionally, the PortalCacheProvider is a feature of the Coherence Enterprise Edition and Coherence Grid Edition. It cannot be used in a Coherence Standard Edition cluster.

m_fClusterOwned
True to indicate that the CacheProvider should shutdown the cluster when it is shutdown.

protected boolean

m_fEntrySetRealized
True to indicate that the Cache implementations returned by this CacheProvider should return a fully realized set of cached values from the entrySet() method rather than a virtual collection of values.

protected boolean

m_fReloadableCacheSupported
True to indicate that the CacheProvider should return Cache implementations that support the ReloadableCache API.

isClusterOwned()
Determine if the CacheProvider should shutdown the cluster when it is shutdown.

protected boolean

isEntrySetRealized()
Determine if the CacheProvider should return Cache implementations that return a fully realized set of cached values from the entrySet() method, rather than a virtual collection of cached values.

m_factory

m_xmlConfig

m_fClusterOwned

protected boolean m_fClusterOwned

True to indicate that the CacheProvider should shutdown the cluster when it is shutdown.

m_fEntrySetRealized

protected boolean m_fEntrySetRealized

True to indicate that the Cache implementations returned by this CacheProvider should return a fully realized set of cached values from the entrySet() method rather than a virtual collection of values.

m_fReloadableCacheSupported

protected boolean m_fReloadableCacheSupported

True to indicate that the CacheProvider should return Cache implementations that support the ReloadableCache API.

m_sScopeSeparator

protected java.lang.String m_sScopeSeparator

The string that separates the Cache name from the scope identifier in the fully qualified name of the delegate NamedCache.

m_sInvocationServiceName

protected java.lang.String m_sInvocationServiceName

The name of the InvocationService used by the CacheProvider to send messages to remote cluster nodes.

getProviderId

public java.lang.String getProviderId()

Return a unique identifier for this CacheProvider.

This identifier is used to uniquely identify a provider during configuration. It is suggested that this identifier be based on the vendor package namespace, such as "com.bea.p13n" (which is the identifier for the default P13nCacheProvider).

Specified by:

getProviderId in class com.bea.p13n.cache.spi.CacheProvider

Returns:

the unique identifier for this CacheProvider

getVendorInfo

public java.lang.String getVendorInfo()

Returns the name of the organization, vendor, or company that provided this implementation.

Specified by:

getVendorInfo in class com.bea.p13n.cache.spi.CacheProvider

Returns:

the name of the vendor that implemented this CacheProvider

getVersionString

public java.lang.String getVersionString()

Return the version of this CacheProvider implementation.

Specified by:

getVersionString in class com.bea.p13n.cache.spi.CacheProvider

Returns:

the version string

getDescription

protected java.lang.String getDescription()

Return a string representation of this CacheProvider's attributes.

Returns:

a string representation of this CacheProvider's attributes

init

public void init()

Initialize the CacheProvider.

This method is called immediately after instantiation but before the provider is used.

Overrides:

init in class com.bea.p13n.cache.spi.CacheProvider

release

public void release()

Release all local resources associated with the CacheProvider.

The CacheFactory will call this method after the J2EE application for which this CacheProvider is providing Cache implementations is shutdown.

Releasing a CacheProvider makes it no longer usable; any attempt to use the CacheProvider may result in an exception.

Overrides:

release in class com.bea.p13n.cache.spi.CacheProvider

getCache

It is the responsibility of the CacheProvider to perform any necessary Cache configuration before returning the Cache instance from this method. The Cache configuration mechanism is assumed to be vendor specific.

Specified by:

getCache in class com.bea.p13n.cache.spi.CacheProvider

Parameters:

sName - the name of the Cache to return; must be non-null and non- empty

config - suggested Cache configuration that may be used by the CacheProvider to configure the returned Cache; this may be ignored by the CacheProvider

Returns:

a Cache instance identified by the given name

Throws:

java.lang.IllegalArgumentException - if the given Cache name is invalid

flushCache

public void flushCache(java.lang.String sName,
java.lang.Object oKey)

Flush all clustered replicas of the Cache with the given name.

Overrides:

flushCache in class com.bea.p13n.cache.spi.CacheProvider

Parameters:

sName - the name of the Cache to flush; must not be null

oKey - an optional key; if not null, only the entry with the given key should be flushed from all clustered replicas

releaseCache

public void releaseCache(com.bea.p13n.cache.Cache cache)

Release all local resources associated with the specified Cache instance.

Releasing a Cache reference makes it no longer usable; any attempt to use the reference may result in an exception.