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:
java.io.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
protected 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 lateral)
          Replaces the current remote cache service handle with the given handle.
 AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
          This returns the generic attributes for an auxiliary cache.
 java.lang.String getCacheName()
          Gets the cacheName attribute of the LateralCache object
 int getCacheType()
          Gets the cacheType attribute of the LateralCache object
 java.lang.String getEventLoggingExtraInfo()
          Gets the extra info for the event log.
 java.util.Set getGroupKeys(java.lang.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.
 java.lang.String getStats()
          getStats
 int getStatus()
          Returns the cache status.
protected  void processDispose()
          Synchronously dispose the cache.
protected  ICacheElement processGet(java.io.Serializable key)
          The performance costs are too great.
protected  java.util.Map processGetMatching(java.lang.String pattern)
          Implementation of getMatching.
protected  java.util.Map processGetMultiple(java.util.Set keys)
          Gets multiple items from the cache based on the given set of keys.
protected  boolean processRemove(java.io.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.
 java.lang.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

protected LateralCache(ILateralCacheAttributes cattr)
Constructor for the LateralCache object

Parameters:
cattr -
Method Detail

processUpdate

protected void processUpdate(ICacheElement ce)
                      throws java.io.IOException
Update lateral.

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

processGet

protected ICacheElement processGet(java.io.Serializable key)
                            throws java.io.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:
java.io.IOException

processGetMatching

protected java.util.Map processGetMatching(java.lang.String pattern)
                                    throws java.io.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:
java.io.IOException

processGetMultiple

protected java.util.Map processGetMultiple(java.util.Set keys)
                                    throws java.io.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:
java.io.IOException

getGroupKeys

public java.util.Set getGroupKeys(java.lang.String groupName)
Description copied from interface: AuxiliaryCache
Gets the set of keys of objects currently in the group

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

processRemove

protected boolean processRemove(java.io.Serializable key)
                         throws java.io.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:
java.io.IOException

processRemoveAll

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

Specified by:
processRemoveAll in class AbstractAuxiliaryCacheEventLogging
Throws:
java.io.IOException

processDispose

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

Specified by:
processDispose in class AbstractAuxiliaryCacheEventLogging
Throws:
java.io.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 java.lang.String getCacheName()
Gets the cacheName attribute of the LateralCache object

Returns:
The cacheName value

fixCache

public void fixCache(ILateralCacheService lateral)
Replaces the current remote cache service handle with the given handle.

Parameters:
lateral -

getStats

public java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
debugging data.

getEventLoggingExtraInfo

public java.lang.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-2010 Apache Software Foundation. All Rights Reserved.