org.apache.jcs.auxiliary.lateral
Class LateralCache

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

public class LateralCache
extends AbstractAuxiliaryCacheEventLogging

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
LateralCache(ILateralCacheAttributes cattr)
          Constructor for the LateralCache object
LateralCache(ILateralCacheAttributes cattr, ILateralCacheService lateral, LateralCacheMonitor monitor)
          Constructor for the LateralCache object
 
Method Summary
 void fixCache(ILateralCacheService 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
 int getCacheType()
          Gets the cacheType attribute of the LateralCache object
 String getEventLoggingExtraInfo()
          Gets the extra info for the event log.
 Set getGroupKeys(String groupName)
          Gets the set of keys of objects currently in the group
 int getSize()
          Returns the current cache size.
 IStats getStatistics()
          The NoWait on top does not call out to here yet.
 String getStats()
          getStats
 int getStatus()
          Returns the cache status.
protected  void processDispose()
          Synchronously dispose the cache.
protected  ICacheElement processGet(Serializable key)
          The performance costs are too great.
protected  Map processGetMatching(String pattern)
          Implementation of getMatching.
protected  Map processGetMultiple(Set keys)
          Gets multiple items from the cache based on the given set of keys.
protected  boolean processRemove(Serializable 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 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,
                    ILateralCacheService 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 ce)
                      throws IOException
Update lateral.

Specified by:
processUpdate in class AbstractAuxiliaryCacheEventLogging
Parameters:
ce -
Throws:
IOException

processGet

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

Specified by:
processGet in class AbstractAuxiliaryCacheEventLogging
Parameters:
key -
Returns:
ICacheElement or null
Throws:
IOException

processGetMatching

protected Map processGetMatching(String pattern)
                          throws IOException
Description copied from class: AbstractAuxiliaryCacheEventLogging
Implementation of getMatching.

Specified by:
processGetMatching in class AbstractAuxiliaryCacheEventLogging
Parameters:
pattern -
Returns:
A map of Serializable 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 processGetMultiple(Set keys)
                          throws IOException
Gets multiple items from the cache based on the given set of keys.

Specified by:
processGetMultiple in class AbstractAuxiliaryCacheEventLogging
Parameters:
keys -
Returns:
a map of Serializable 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 getGroupKeys(String groupName)
                 throws IOException
Description copied from interface: AuxiliaryCache
Gets the set of keys of objects currently in the group

Parameters:
groupName -
Returns:
A set of group keys.
Throws:
IOException

processRemove

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

Specified by:
processRemove in class AbstractAuxiliaryCacheEventLogging
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
Throws:
IOException

processDispose

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

Specified by:
processDispose in class AbstractAuxiliaryCacheEventLogging
Throws:
IOException

getStatus

public int getStatus()
Returns the cache status.

Returns:
The status value

getSize

public int getSize()
Returns the current cache size.

Returns:
The size value

getCacheType

public int 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(ILateralCacheService 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
Returns:
extra data.

getStatistics

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

Returns:
almost nothing


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.