|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.bea.p13n.cache.spi.CacheProvider
com.tangosol.coherence.weblogic.PortalCacheProvider
public class PortalCacheProvider
WebLogic Portal CacheProvider implementation that provides Cache instances that use Coherence™ to cache data. <p/> 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. <p/> 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. <p/> 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:
Property Description Default Value ClusterOwned
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. false EntrySetRealized
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. false ReloadableCacheSupported
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. false ScopeSeparator
The string that separates the Cache name from the scope identifier in the fully qualified name of the delegate NamedCache. : InvocationServiceName
The name of the InvocationService used to send messages to remote cluster nodes. INVOCATION_SERVICE_NAME
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.
Nested Class Summary | |
---|---|
protected class |
PortalCacheProvider.CacheImpl Cache implementation that delegates most operations to a Coherence NamedCache. |
static class |
PortalCacheProvider.FlushAgent Invocable implementation that is used to flush a Cache instance located on one or more remote cluster nodes. |
protected class |
PortalCacheProvider.ReloadableCacheImpl CacheImpl extension that supports the ReloadableCache interface. |
Field Summary | |
---|---|
static String |
INVOCATION_SERVICE_NAME The default name of the InvocationService used by the CacheProvider. |
protected ConfigurableCacheFactory |
m_factory The CacheProvider's own ConfigurableCacheFactory. |
protected boolean |
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. |
protected InvocationService |
m_serviceInvocation The InvocationService used by the CacheProvider. |
protected String |
m_sInvocationServiceName The name of the InvocationService used by the CacheProvider to send messages to remote cluster nodes. |
protected String |
m_sScopeSeparator The string that separates the Cache name from the scope identifier in the fully qualified name of the delegate NamedCache. |
protected XmlElement |
m_xmlConfig The CacheProvider's configuration. |
static String |
PATH_CACHE_CONFIG The name of the required resource that will be used to configure the CacheProvider's own ConfigurableCacheFactory. |
static String |
PATH_PROVIDER_CONFIG The name of the optional resource that will be used to configure the CacheProvider itself. |
Constructor Summary | |
---|---|
PortalCacheProvider() Default constructor. |
Method Summary | |
---|---|
protected InvocationService |
ensureInvocationService() Obtain the Coherence InvocationService used by the CacheProvider, initializing it if it hasn't already been initialized. |
void |
flushCache(String sName, Object oKey) Flush all clustered replicas of the Cache with the given name. |
protected static com.bea.p13n.cache.Cache |
getCache(String sName) Obtain an existing P13N Cache by name. |
com.bea.p13n.cache.Cache |
getCache(String sName, com.bea.p13n.cache.CacheConfig config) Return a Cache implementation with the given name. |
XmlElement |
getConfig() Determine the current configuration of the object. |
protected ConfigurableCacheFactory |
getConfigurableCacheFactory() Obtain the ConfigurableCacheFactory used by this PortalCacheFactory. |
protected String |
getDescription() Return a string representation of this CacheProvider's attributes. |
protected String |
getInvocationServiceName() Determine the name of the InvocationService used by the CacheProvider to send messages to remote cluster nodes. |
protected NamedCache |
getNamedCache(String sName) Obtain a Coherence NamedCache by name. |
String |
getProviderId() Return a unique identifier for this CacheProvider. |
protected String |
getQualifiedCacheName(String sName) Given a Cache name as passed from the CacheFactory, return a fully-qualified Cache name that contains the CacheProvider scope identifier. |
protected String |
getScopeSeparator() Determine the string that separates the Cache name from the scope identifier in the fully qualified name of the delegate NamedCache. |
protected String |
getUnqualifiedCacheName(String sName) Given a qualified cache name as returned by the getQualifiedCacheName(String) method, return the unqualified name that does not contain the CacheProvider scope identifier. |
String |
getVendorInfo() Returns the name of the organization, vendor, or company that provided this implementation. |
String |
getVersionString() Return the version of this CacheProvider implementation. |
void |
init() Initialize the CacheProvider. |
protected PortalCacheProvider.CacheImpl |
instantiateCacheImpl(String sName, NamedCache cache) Factory pattern: Create a new CacheImpl. |
protected PortalCacheProvider.FlushAgent |
instantiateFlushAgent(String sName, Object oKey) Factory pattern: Create a new FlushAgent. |
protected boolean |
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. |
protected static boolean |
isLocalCache(NamedCache cache) Determine if the given NamedCache is a LocalCache. |
protected boolean |
isReloadableCacheSupported() Determine if the CacheProvider should return Cache implementations that support the ReloadableCache API. |
protected static Object |
put(CacheMap cache, Object oKey, Object oValue, long cMillis) Cache the given value in the specified CacheMap using the specified time-to-live and return the old cached value. |
protected static void |
putBlind(CacheMap cache, Object oKey, Object oValue, long cMillis) Cache the given value in the specified CacheMap using the specified time-to-live. |
void |
release() Release all local resources associated with the CacheProvider. |
void |
releaseCache(com.bea.p13n.cache.Cache cache) Release all local resources associated with the specified Cache instance. |
void |
setConfig(XmlElement xmlConfig) Specify the configuration for the object. |
String |
toString() Return a human readable String representation of this CacheProvider. |
Methods inherited from class com.bea.p13n.cache.spi.CacheProvider |
---|
getScopeIdentifier |
Field Detail |
---|
protected ConfigurableCacheFactory m_factory
protected XmlElement m_xmlConfig
protected boolean m_fClusterOwned
protected boolean m_fEntrySetRealized
protected boolean m_fReloadableCacheSupported
protected String m_sScopeSeparator
protected String m_sInvocationServiceName
protected InvocationService m_serviceInvocation
public static final String PATH_PROVIDER_CONFIG
public static final String PATH_CACHE_CONFIG
public static final String INVOCATION_SERVICE_NAME
Constructor Detail |
---|
public PortalCacheProvider()
Method Detail |
---|
public XmlElement getConfig()
getConfig
in interface XmlConfigurable
public void setConfig(XmlElement xmlConfig)
setConfig
in interface XmlConfigurable
xmlConfig
- the XML configuration for the objectpublic String toString()
toString
in class com.bea.p13n.cache.spi.CacheProvider
public String getProviderId()
getProviderId
in class com.bea.p13n.cache.spi.CacheProvider
public String getVendorInfo()
getVendorInfo
in class com.bea.p13n.cache.spi.CacheProvider
public String getVersionString()
getVersionString
in class com.bea.p13n.cache.spi.CacheProvider
protected String getDescription()
public void init()
init
in class com.bea.p13n.cache.spi.CacheProvider
public void release()
release
in class com.bea.p13n.cache.spi.CacheProvider
public com.bea.p13n.cache.Cache getCache(String sName, com.bea.p13n.cache.CacheConfig config)
getCache
in class com.bea.p13n.cache.spi.CacheProvider
sName
- the name of the Cache to return; must be non-null and non- emptyconfig
- suggested Cache configuration that may be used by the CacheProvider to configure the returned Cache; this may be ignored by the CacheProviderIllegalArgumentException
- if the given Cache name is invalidpublic void flushCache(String sName, Object oKey)
flushCache
in class com.bea.p13n.cache.spi.CacheProvider
sName
- the name of the Cache to flush; must not be nulloKey
- an optional key; if not null, only the entry with the given key should be flushed from all clustered replicaspublic void releaseCache(com.bea.p13n.cache.Cache cache)
releaseCache
in class com.bea.p13n.cache.spi.CacheProvider
cache
- the Cache to releaseprotected String getQualifiedCacheName(String sName)
sName
- the unqualified cache name; must not be nullIllegalArgumentException
- if the given Cache name is invalidprotected String getUnqualifiedCacheName(String sName)
getQualifiedCacheName(String)
method, return the unqualified name that does not contain the CacheProvider scope identifier.sName
- the fully-qualified cache name; must not be nullprotected InvocationService ensureInvocationService()
protected static boolean isLocalCache(NamedCache cache)
cache
- the NamedCache to testprotected static com.bea.p13n.cache.Cache getCache(String sName)
sName
- the name of the Cache to obtainprotected ConfigurableCacheFactory getConfigurableCacheFactory()
protected NamedCache getNamedCache(String sName)
sName
- the name of the NamedCache to obtainprotected static Object put(CacheMap cache, Object oKey, Object oValue, long cMillis)
CacheMap.EXPIRY_DEFAULT
or if the CacheMap does not support the extended put()
method, the standard put() method is used.cache
- the target CacheMapoKey
- the key with which to cache the valueoValue
- the value to cachecMillis
- the time-to-live of the cached entryprotected static void putBlind(CacheMap cache, Object oKey, Object oValue, long cMillis)
CacheMap.EXPIRY_DEFAULT
or if the CacheMap does not support the extended put()
method, the putAll() method is used.cache
- the target CacheMapoKey
- the key with which to cache the valueoValue
- the value to cachecMillis
- the time-to-live of the cached entryprotected PortalCacheProvider.CacheImpl instantiateCacheImpl(String sName, NamedCache cache)
sName
- the name of the Cache; must not be nullcache
- the delegate NamedCache used to implement most cache operations; must not be nullprotected PortalCacheProvider.FlushAgent instantiateFlushAgent(String sName, Object oKey)
sName
- the name of the Cache to flush; must not be nulloKey
- an optional key; if non-null, only the Cache entry with the given key will be flushedprotected boolean isClusterOwned()
protected boolean isEntrySetRealized()
protected boolean isReloadableCacheSupported()
protected String getScopeSeparator()
protected String getInvocationServiceName()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |