Class AbstractRemoteCacheNoWaitFacade<K,V>
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.commons.jcs3.auxiliary.remote.AbstractRemoteCacheNoWaitFacade<K,V>
- All Implemented Interfaces:
AuxiliaryCache<K,
,V> ICache<K,
,V> ICacheType
- Direct Known Subclasses:
RemoteCacheNoWaitFacade
An abstract base for the No Wait Facade. Different implementations will failover differently.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheType
ICacheType.CacheType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<RemoteCacheNoWait<K,
V>> The connection to a remote server, or a zombie.Fields inherited from interface org.apache.commons.jcs3.engine.behavior.ICache
NAME_COMPONENT_DELIMITER
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRemoteCacheNoWaitFacade
(List<RemoteCacheNoWait<K, V>> noWaits, IRemoteCacheAttributes rca, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Constructs with the given remote cache, and fires events to any listeners. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Adds a dispose request to the remote cache.protected abstract void
failover
(RemoteCacheNoWait<K, V> rcnw) Begin the failover process if this is a local cache.Synchronously reads from the remote cache.This returns the generic attributes for an auxiliary cache.Gets the cacheName attribute of the RemoteCacheNoWaitFacade object.Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.This typically returns end point info .Return the keys in this cache.Map<K,
ICacheElement<K, V>> getMatching
(String pattern) Synchronously read from the remote cache.Map<K,
ICacheElement<K, V>> getMultiple
(Set<K> keys) Gets multiple items from the cache based on the given set of keys.Get the primary server from the list of failoversint
getSize()
No remote invocation.getStats()
getStatsGets the status attribute of the RemoteCacheNoWaitFacade objectboolean
Adds a remove request to the remote cache.void
Adds a removeAll request to the remote cache.void
restorePrimaryServer
(RemoteCacheNoWait<K, V> rcnw) restore the primary server in the list of failoverstoString()
String form of some of the configuration information for the remote cache.void
update
(ICacheElement<K, V> ce) Put an element in the cache.Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
-
Field Details
-
noWaits
The connection to a remote server, or a zombie.
-
-
Constructor Details
-
AbstractRemoteCacheNoWaitFacade
public AbstractRemoteCacheNoWaitFacade(List<RemoteCacheNoWait<K, V>> noWaits, IRemoteCacheAttributes rca, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Constructs with the given remote cache, and fires events to any listeners.- Parameters:
noWaits
-rca
-cacheEventLogger
-elementSerializer
-
-
-
Method Details
-
update
Put an element in the cache.- Parameters:
ce
-- Throws:
IOException
-
get
Synchronously reads from the remote cache.- Specified by:
get
in interfaceICache<K,
V> - Specified by:
get
in classAbstractAuxiliaryCache<K,
V> - Parameters:
key
-- Returns:
- Either an ICacheElement<K, V> or null if it is not found.
- Throws:
IOException
-
getMatching
Synchronously read from the remote cache.- Parameters:
pattern
-- Returns:
- map
- Throws:
IOException
-
getMultiple
Gets multiple items from the cache based on the given set of keys.- Parameters:
keys
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
IOException
-
getKeySet
Return the keys in this cache.- Returns:
- a set of the key type TODO This should probably be done in chunks with a range passed in. This will be a problem if someone puts a 1,000,000 or so items in a region.
- Throws:
IOException
- if access to the auxiliary cache fails- See Also:
-
remove
Adds a remove request to the remote cache.- Parameters:
key
-- Returns:
- whether or not it was removed, right now it return false.
- Throws:
IOException
-
removeAll
Adds a removeAll request to the remote cache.- Throws:
IOException
-
dispose
Adds a dispose request to the remote cache. -
getSize
No remote invocation.- Returns:
- The size value
-
getCacheType
Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.- Returns:
- The cacheType value
-
getCacheName
Gets the cacheName attribute of the RemoteCacheNoWaitFacade object.- Returns:
- The cacheName value
-
getStatus
Gets the status attribute of the RemoteCacheNoWaitFacade objectReturn ALIVE if any are alive.
- Returns:
- The status value
-
toString
String form of some of the configuration information for the remote cache. -
failover
Begin the failover process if this is a local cache. Clustered remote caches do not failover.- Parameters:
rcnw
- The no wait in error.
-
getPrimaryServer
Get the primary server from the list of failovers- Returns:
- a no wait
-
restorePrimaryServer
restore the primary server in the list of failovers -
getAuxiliaryCacheAttributes
Description copied from interface:AuxiliaryCache
This returns the generic attributes for an auxiliary cache. Most implementations will cast this to a more specific type.- Returns:
- Returns the AuxiliaryCacheAttributes.
-
getStats
getStats- Returns:
- String
-
getStatistics
- Returns:
- statistics about the cache region
-
getEventLoggingExtraInfo
This typically returns end point info .- Specified by:
getEventLoggingExtraInfo
in classAbstractAuxiliaryCache<K,
V> - Returns:
- the name
-