org.apache.jcs.auxiliary.lateral
Class LateralCache<K extends Serializable,V extends Serializable>

java.lang.Object
  extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCache<K,V>
      extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging<K,V>
          extended by org.apache.jcs.auxiliary.lateral.LateralCache<K,V>
All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType

public class LateralCache<K extends Serializable,V extends Serializable>
extends AbstractAuxiliaryCacheEventLogging<K,V>

Lateral distributor. Returns null on get by default. Net search not implemented.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jcs.engine.behavior.ICacheType
ICacheType.CacheType
 
Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Constructor Summary
LateralCache(ILateralCacheAttributes cattr)
          Constructor for the LateralCache object
LateralCache(ILateralCacheAttributes cattr, ICacheServiceNonLocal<K,V> lateral, LateralCacheMonitor monitor)
          Constructor for the LateralCache object
 
Method Summary
 void fixCache(ICacheServiceNonLocal<K,V> restoredLateral)
          Replaces the current remote cache service handle with the given handle.
 AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
          This returns the generic attributes for an auxiliary cache.
 String getCacheName()
          Gets the cacheName attribute of the LateralCache object
 ICacheType.CacheType getCacheType()
          Gets the cacheType attribute of the LateralCache object
 String getEventLoggingExtraInfo()
          Gets the extra info for the event log.
 Set<K> getGroupKeys(String groupName)
          Gets the set of keys of objects currently in the group.
 Set<String> getGroupNames()
          Gets the set of group names in the cache
 int getSize()
          Returns the current cache size.
 IStats getStatistics()
          The NoWait on top does not call out to here yet.
 String getStats()
          getStats
 CacheStatus getStatus()
          Returns the cache status.
protected  void processDispose()
          Synchronously dispose the cache.
protected  ICacheElement<K,V> processGet(K key)
          The performance costs are too great.
protected  Map<K,ICacheElement<K,V>> processGetMatching(String pattern)
          Implementation of getMatching.
protected  Map<K,ICacheElement<K,V>> processGetMultiple(Set<K> keys)
          Gets multiple items from the cache based on the given set of keys.
protected  boolean processRemove(K key)
          Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie.
protected  void processRemoveAll()
          Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie.
protected  void processUpdate(ICacheElement<K,V> ce)
          Update lateral.
 String toString()
           
 
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLogging
 
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
 

Constructor Detail

LateralCache

public LateralCache(ILateralCacheAttributes cattr,
                    ICacheServiceNonLocal<K,V> lateral,
                    LateralCacheMonitor monitor)
Constructor for the LateralCache object

Parameters:
cattr -
lateral -
monitor -

LateralCache

public LateralCache(ILateralCacheAttributes cattr)
Constructor for the LateralCache object

Parameters:
cattr -
Method Detail

processUpdate

protected void processUpdate(ICacheElement<K,V> ce)
                      throws IOException
Update lateral.

Specified by:
processUpdate in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Parameters:
ce -
Throws:
IOException

processGet

protected ICacheElement<K,V> processGet(K key)
                                                                           throws IOException
The performance costs are too great. It is not recommended that you enable lateral gets.

Specified by:
processGet in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Parameters:
key -
Returns:
ICacheElement or null
Throws:
IOException

processGetMatching

protected Map<K,ICacheElement<K,V>> processGetMatching(String pattern)
                                                                                                               throws IOException
Description copied from class: AbstractAuxiliaryCacheEventLogging
Implementation of getMatching.

Specified by:
processGetMatching in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Parameters:
pattern -
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
Throws:
IOException

processGetMultiple

protected Map<K,ICacheElement<K,V>> processGetMultiple(Set<K> keys)
                                                                                                               throws IOException
Gets multiple items from the cache based on the given set of keys.

Specified by:
processGetMultiple in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
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
Throws:
IOException

getGroupKeys

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

Parameters:
group -
Returns:
a Set of group keys.
Throws:
IOException

getGroupNames

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

Returns:
a Set of group names.
Throws:
IOException

processRemove

protected boolean processRemove(K key)
                         throws IOException
Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie.

Specified by:
processRemove in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Parameters:
key -
Returns:
false always
Throws:
IOException

processRemoveAll

protected void processRemoveAll()
                         throws IOException
Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie.

Specified by:
processRemoveAll in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Throws:
IOException

processDispose

protected void processDispose()
                       throws IOException
Synchronously dispose the cache. Not sure we want this.

Specified by:
processDispose in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>
Throws:
IOException

getStatus

public CacheStatus getStatus()
Returns the cache status.

Returns:
The status value

getSize

public int getSize()
Returns the current cache size.

Returns:
The size value

getCacheType

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

Returns:
The cacheType value

getCacheName

public String getCacheName()
Gets the cacheName attribute of the LateralCache object

Returns:
The cacheName value

fixCache

public void fixCache(ICacheServiceNonLocal<K,V> restoredLateral)
Replaces the current remote cache service handle with the given handle.

Parameters:
restoredLateral -

getStats

public String getStats()
getStats

Returns:
String

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.

toString

public String toString()
Overrides:
toString in class Object
Returns:
debugging data.

getEventLoggingExtraInfo

public String getEventLoggingExtraInfo()
Description copied from class: AbstractAuxiliaryCache
Gets the extra info for the event log.

Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache<K extends Serializable,V extends Serializable>
Returns:
extra data.

getStatistics

public IStats getStatistics()
The NoWait on top does not call out to here yet.

Returns:
almost nothing


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