org.apache.jcs.auxiliary.lateral
Class LateralCacheAbstractManager

java.lang.Object
  extended by org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager
All Implemented Interfaces:
AuxiliaryCacheManager, ILateralCacheManager, IShutdownObserver
Direct Known Subclasses:
LateralTCPCacheManager

public abstract class LateralCacheAbstractManager
extends Object
implements ILateralCacheManager, IShutdownObserver

Creates lateral caches. Lateral caches are primarily used for removing non laterally configured caches. Non laterally configured cache regions should still be able 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 Acceptable for all - cache managers or a manager within a type


Field Summary
protected  ICacheEventLogger cacheEventLogger
          The event logger.
protected  Map<String,LateralCacheNoWait<? extends Serializable,? extends Serializable>> caches
          Each manager instance has caches.
protected  IElementSerializer elementSerializer
          The serializer.
protected  ILateralCacheAttributes lca
          Configuration
 
Constructor Summary
LateralCacheAbstractManager()
           
 
Method Summary
<K extends Serializable,V extends Serializable>
void
addLateralCacheListener(String cacheName, ILateralCacheListener<K,V> listener)
          Adds the lateral cache listener to the underlying cache-watch service.
 void fixCaches(ICacheServiceNonLocal<Serializable,Serializable> lateralService, ILateralCacheObserver lateralWatch)
          Fixes up all the caches managed by this cache manager.
abstract
<K extends Serializable,V extends Serializable>
AuxiliaryCache<K,V>
getCache(String cacheName)
          Called to access a pre-created region or construct one with defaults.
 Map<String,LateralCacheNoWait<? extends Serializable,? extends Serializable>> getCaches()
          This is a temporary solution that allows the monitor to get caches from an instance of a manager.
 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
 
Methods inherited from interface org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager
fixService, getInstances
 
Methods inherited from interface org.apache.jcs.engine.behavior.IShutdownObserver
shutdown
 

Field Detail

caches

protected final Map<String,LateralCacheNoWait<? extends Serializable,? extends Serializable>> caches
Each manager instance has caches.


lca

protected ILateralCacheAttributes lca
Configuration


cacheEventLogger

protected ICacheEventLogger cacheEventLogger
The event logger.


elementSerializer

protected IElementSerializer elementSerializer
The serializer.

Constructor Detail

LateralCacheAbstractManager

public LateralCacheAbstractManager()
Method Detail

addLateralCacheListener

public <K extends Serializable,V extends Serializable> void addLateralCacheListener(String cacheName,
                                                                                    ILateralCacheListener<K,V> listener)
                             throws 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:
IOException

getCache

public abstract <K extends Serializable,V extends Serializable> AuxiliaryCache<K,V> getCache(String cacheName)
Called to access a pre-created region or construct one with defaults. Since all aux cache access goes through the manager, this will never be called.

After getting the manager instance for a server, the factory gets a cache for the region name it is constructing.

There should be one manager per server and one cache per region per manager.

Specified by:
getCache in interface AuxiliaryCacheManager
Parameters:
cacheName -
Returns:
AuxiliaryCache

getStats

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

Returns:
String

fixCaches

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

Specified by:
fixCaches in interface ILateralCacheManager
Parameters:
lateralService -
lateralWatch -

getCaches

public Map<String,LateralCacheNoWait<? extends Serializable,? extends Serializable>> getCaches()
Description copied from interface: ILateralCacheManager
This is a temporary solution that allows the monitor to get caches from an instance of a manager.

Specified by:
getCaches in interface ILateralCacheManager
Returns:
Map


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