org.apache.jcs.auxiliary.lateral.socket.tcp
Class LateralTCPCacheManager

java.lang.Object
  extended by org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager
      extended by org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager
All Implemented Interfaces:
Serializable, AuxiliaryCacheManager, ILateralCacheManager, ICacheType, IShutdownObserver

public class LateralTCPCacheManager
extends LateralCacheAbstractManager

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

See Also:
Serialized Form

Field Summary
protected static Map instances
          Address to instance map.
protected  ITCPLateralCacheAttributes lateralCacheAttribures
          ITCPLateralCacheAttributes
 
Fields inherited from class org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager
cacheEventLogger, caches, elementSerializer, lca
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Method Summary
 void addLateralCacheListener(String cacheName, ILateralCacheListener listener)
          Adds the lateral cache listener to the underlying cache-watch service.
 Object fixService()
          The restore calls this on the manger if a cache if found to be in error.
 AuxiliaryCache getCache(String cacheName)
          Called to access a precreated region or construct one with defaults.
static LateralTCPCacheManager getInstance(ITCPLateralCacheAttributes lca, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
          Returns an instance of the LateralCacheManager.
 Map getInstances()
          This is a temporary solution that allows the monitor to get the instances of a manager.
 void shutdown()
          Shuts down the lateral sender.
 
Methods inherited from class org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager
fixCaches, getCaches, getCacheType, getStats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instances

protected static Map instances
Address to instance map.


lateralCacheAttribures

protected ITCPLateralCacheAttributes lateralCacheAttribures
ITCPLateralCacheAttributes

Method Detail

getInstance

public static LateralTCPCacheManager getInstance(ITCPLateralCacheAttributes lca,
                                                 ICompositeCacheManager cacheMgr,
                                                 ICacheEventLogger cacheEventLogger,
                                                 IElementSerializer elementSerializer)
Returns an instance of the LateralCacheManager.

Parameters:
lca -
cacheMgr - this allows the auxiliary to be passed a cache manager.
cacheEventLogger -
elementSerializer -
Returns:
LateralTCPCacheManager

addLateralCacheListener

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

Overrides:
addLateralCacheListener in class LateralCacheAbstractManager
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 AuxiliaryCache getCache(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.

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
Specified by:
getCache in class LateralCacheAbstractManager
Parameters:
cacheName -
Returns:
AuxiliaryCache

getInstances

public Map getInstances()
Description copied from interface: ILateralCacheManager
This is a temporary solution that allows the monitor to get the instances of a manager.

Returns:
Map

fixService

public Object fixService()
                  throws IOException
Description copied from interface: ILateralCacheManager
The restore calls this on the manger if a cache if found to be in error.

Returns:
a new service
Throws:
IOException

shutdown

public void shutdown()
Shuts down the lateral sender. This does not shutdown the listener. This can be called if the end point is taken out of service.



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