org.apache.jcs.auxiliary.remote
Class AbstractRemoteCacheNoWaitFacade<K extends Serializable,V extends Serializable>

java.lang.Object
  extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCache<K,V>
      extended by org.apache.jcs.auxiliary.remote.AbstractRemoteCacheNoWaitFacade<K,V>
All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType
Direct Known Subclasses:
RemoteCacheNoWaitFacade

public abstract class AbstractRemoteCacheNoWaitFacade<K extends Serializable,V extends Serializable>
extends AbstractAuxiliaryCache<K,V>

An abstract base for the No Wait Facade. Different implementations will failover differently.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jcs.engine.behavior.ICacheType
ICacheType.CacheType
 
Field Summary
 RemoteCacheNoWait<K,V>[] noWaits
          The connection to a remote server, or a zombie.
protected  IRemoteCacheAttributes remoteCacheAttributes
          holds failover and cluster information
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Constructor Summary
AbstractRemoteCacheNoWaitFacade(RemoteCacheNoWait<K,V>[] noWaits, RemoteCacheAttributes rca, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
          Constructs with the given remote cache, and fires events to any listeners.
 
Method Summary
 void dispose()
          Adds a dispose request to the remote cache.
 ICacheElement<K,V> get(K key)
          Synchronously reads from the remote cache.
 AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
          This returns the generic attributes for an auxiliary cache.
 String getCacheName()
          Gets the cacheName attribute of the RemoteCacheNoWaitFacade object.
 ICacheType.CacheType getCacheType()
          Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.
protected  ICompositeCacheManager getCompositeCacheManager()
           
 String getEventLoggingExtraInfo()
          This typically returns end point info .
 Set<K> getGroupKeys(String group)
          Gets the set of keys of objects currently in the group.
 Set<String> getGroupNames()
          Gets the group names in the 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.
 IRemoteCacheAttributes getRemoteCacheAttributes()
          Gets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object
 int getSize()
          No remote invocation.
 IStats getStatistics()
           
 String getStats()
          getStats
 CacheStatus getStatus()
          Gets the status attribute of the RemoteCacheNoWaitFacade object Return ALIVE if any are alive.
 boolean remove(K key)
          Adds a remove request to the remote cache.
 void removeAll()
          Adds a removeAll request to the remote cache.
protected  void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
           
 void setRemoteCacheAttributes(IRemoteCacheAttributes rca)
          Sets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object.
 String toString()
          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.jcs.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noWaits

public RemoteCacheNoWait<K extends Serializable,V extends Serializable>[] noWaits
The connection to a remote server, or a zombie.


remoteCacheAttributes

protected IRemoteCacheAttributes remoteCacheAttributes
holds failover and cluster information

Constructor Detail

AbstractRemoteCacheNoWaitFacade

public AbstractRemoteCacheNoWaitFacade(RemoteCacheNoWait<K,V>[] noWaits,
                                       RemoteCacheAttributes rca,
                                       ICompositeCacheManager cacheMgr,
                                       ICacheEventLogger cacheEventLogger,
                                       IElementSerializer elementSerializer)
Constructs with the given remote cache, and fires events to any listeners.

Parameters:
noWaits -
rca -
cacheMgr -
cacheEventLogger -
elementSerializer -
Method Detail

update

public void update(ICacheElement<K,V> ce)
            throws IOException
Put an element in the cache.

Parameters:
ce -
Throws:
IOException

get

public ICacheElement<K,V> get(K key)
Synchronously reads from the remote cache.

Parameters:
key -
Returns:
Either an ICacheElement or null if it is not found.

getMatching

public Map<K,ICacheElement<K,V>> getMatching(String pattern)
                                                                                                     throws IOException
Synchronously read from the remote cache.

Parameters:
pattern -
Returns:
map
Throws:
IOException

getMultiple

public Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
Gets multiple items from the cache based on the given set of keys.

Parameters:
keys -
Returns:
a map of K key to ICacheElement element, or an empty map if there is no data in cache for any of these keys

getGroupKeys

public Set<K> getGroupKeys(String group)
                                         throws IOException
Gets the set of keys of objects currently in the group.

Parameters:
group -
Returns:
the set of keys of objects currently in the group
Throws:
IOException

getGroupNames

public Set<String> getGroupNames()
                          throws IOException
Gets the group names in the cache

Returns:
the set of group names
Throws:
IOException

remove

public boolean remove(K key)
Adds a remove request to the remote cache.

Parameters:
key -
Returns:
whether or not it was removed, right now it return false.

removeAll

public void removeAll()
Adds a removeAll request to the remote cache.


dispose

public void dispose()
Adds a dispose request to the remote cache.


getSize

public int getSize()
No remote invocation.

Returns:
The size value

getCacheType

public ICacheType.CacheType getCacheType()
Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.

Returns:
The cacheType value

getCacheName

public String getCacheName()
Gets the cacheName attribute of the RemoteCacheNoWaitFacade object.

Returns:
The cacheName value

getStatus

public CacheStatus getStatus()
Gets the status attribute of the RemoteCacheNoWaitFacade object

Return ALIVE if any are alive.

Returns:
The status value

toString

public String toString()
String form of some of the configuration information for the remote cache.

Overrides:
toString in class Object
Returns:
Some info for logging.

getAuxiliaryCacheAttributes

public AuxiliaryCacheAttributes 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

public String getStats()
getStats

Returns:
String

getStatistics

public IStats getStatistics()
Returns:
statistics about the cache region

getEventLoggingExtraInfo

public String getEventLoggingExtraInfo()
This typically returns end point info .

Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache<K extends Serializable,V extends Serializable>
Returns:
the name

getRemoteCacheAttributes

public IRemoteCacheAttributes getRemoteCacheAttributes()
Gets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object

Returns:
The remoteCacheAttributes value

setRemoteCacheAttributes

public void setRemoteCacheAttributes(IRemoteCacheAttributes rca)
Sets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object.

Parameters:
rca - The new remoteCacheAttributes value

setCompositeCacheManager

protected void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
Parameters:
compositeCacheManager - the compositeCacheManager to set

getCompositeCacheManager

protected ICompositeCacheManager getCompositeCacheManager()
Returns:
the compositeCacheManager


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.