org.apache.jcs.auxiliary.lateral
Class LateralCacheManager

java.lang.Object
  extended byorg.apache.jcs.auxiliary.lateral.LateralCacheManager
All Implemented Interfaces:
AuxiliaryCacheManager, ICacheType, java.io.Serializable

public class LateralCacheManager
extends java.lang.Object
implements AuxiliaryCacheManager

Creates lateral caches. Lateral caches are primarily used for removing non laterally configured caches. Non laterally configured cache regions should still bea ble to participate in removal. But if there is a non laterally configured cache hub, then lateral removals may be necessary. For flat webserver production environments, without a strong machine at the app server level, distribution and search may need to occur at the lateral cache level. This is currently not implemented in the lateral cache. TODO: - need freeCache, release, getStats - need to find an interface acceptible for all - cache managers or a manager within a type

See Also:
Serialized Form

Field Summary
(package private)  java.util.Map caches
           
private  int clients
           
(package private) static java.util.Map instances
           
private  ILateralCacheService lateralService
          Handle to the lateral cache service; or a zombie handle if failed to connect.
private  LateralCacheWatchRepairable lateralWatch
          Wrapper of the lateral cache watch service; or wrapper of a zombie service if failed to connect.
protected  ILateralCacheAttributes lca
          Description of the Field
private static org.apache.commons.logging.Log log
           
private static LateralCacheMonitor monitor
           
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
private LateralCacheManager(ILateralCacheAttributes lca)
          Constructor for the LateralCacheManager object
 
Method Summary
 void addLateralCacheListener(java.lang.String cacheName, ILateralCacheListener listener)
          Adds the lateral cache listener to the underlying cache-watch service.
 void fixCaches(ILateralCacheService lateralService, ILateralCacheObserver lateralWatch)
          Fixes up all the caches managed by this cache manager.
 AuxiliaryCache getCache(java.lang.String cacheName)
          Called to access a precreated region or construct one with defaults.
 int getCacheType()
          Gets the cacheType attribute of the LateralCacheManager object
static LateralCacheManager getInstance(ILateralCacheAttributes lca)
          Gets the instance attribute of the LateralCacheManager class
 java.lang.String getStats()
          Gets the stats attribute of the LateralCacheManager object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

monitor

private static LateralCacheMonitor monitor

instances

static final java.util.Map instances

caches

final java.util.Map caches

lca

protected ILateralCacheAttributes lca
Description of the Field


clients

private int clients

lateralService

private ILateralCacheService lateralService
Handle to the lateral cache service; or a zombie handle if failed to connect.


lateralWatch

private LateralCacheWatchRepairable lateralWatch
Wrapper of the lateral cache watch service; or wrapper of a zombie service if failed to connect.

Constructor Detail

LateralCacheManager

private LateralCacheManager(ILateralCacheAttributes lca)
Constructor for the LateralCacheManager object

Parameters:
lca -
Method Detail

getInstance

public static LateralCacheManager getInstance(ILateralCacheAttributes lca)
Gets the instance attribute of the LateralCacheManager class

Parameters:
lca -
Returns:
The instance value

addLateralCacheListener

public void addLateralCacheListener(java.lang.String cacheName,
                                    ILateralCacheListener listener)
                             throws java.io.IOException
Adds the lateral cache listener to the underlying cache-watch service.

Parameters:
cacheName - The feature to be added to the LateralCacheListener attribute
listener - The feature to be added to the LateralCacheListener attribute
Throws:
java.io.IOException

getCache

public AuxiliaryCache getCache(java.lang.String cacheName)
Called to access a precreated region or construct one with defaults. Since all aux cache access goes through the manager, this will never be called.

Specified by:
getCache in interface AuxiliaryCacheManager
Parameters:
cacheName -
Returns:
The {3} value

getCacheType

public int getCacheType()
Gets the cacheType attribute of the LateralCacheManager object

Specified by:
getCacheType in interface ICacheType
Returns:
The {3} value

getStats

public java.lang.String getStats()
Gets the stats attribute of the LateralCacheManager object

Returns:
The {3} value

fixCaches

public void fixCaches(ILateralCacheService lateralService,
                      ILateralCacheObserver lateralWatch)
Fixes up all the caches managed by this cache manager.

Parameters:
lateralService -
lateralWatch -