org.apache.jcs.auxiliary.lateral
Class LateralCache

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

public class LateralCache
extends java.lang.Object
implements ICache

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

Author:
asmuts
See Also:
Serialized Form

Field Summary
(package private)  IElementAttributes attr
           
(package private)  java.lang.String cacheName
           
(package private)  ILateralCacheAttributes cattr
           
private  java.util.HashMap keyHash
           
private  ILateralCacheService lateral
          either http, socket.udp, or socket.tcp can set in config
private static org.apache.commons.logging.Log log
           
private static int numCreated
           
 
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
protected LateralCache(ILateralCacheAttributes cattr, ILateralCacheService lateral)
          Constructor for the LateralCache object
 
Method Summary
 void dispose()
          Synchronously dispose the cache.
 void fixCache(ILateralCacheService lateral)
          Replaces the current remote cache service handle with the given handle.
 ICacheElement get(java.io.Serializable key)
          Returns null.
 java.lang.String getCacheName()
          Gets the cacheName attribute of the LateralCache object
 int getCacheType()
          Gets the cacheType attribute of the LateralCache object
 java.util.Set getGroupKeys(java.lang.String groupName)
           
 int getSize()
          Returns the current cache size.
 int getStatus()
          Returns the cache status.
private  void handleException(java.lang.Exception ex, java.lang.String msg)
          Not yet sure what to do here.
 boolean remove(java.io.Serializable key)
          Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie.
 void removeAll()
          Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie.
 java.lang.String toString()
          Description of the Method
 void update(ICacheElement ce)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

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

numCreated

private static int numCreated

attr

IElementAttributes attr

keyHash

private java.util.HashMap keyHash

cattr

ILateralCacheAttributes cattr

cacheName

final java.lang.String cacheName

lateral

private ILateralCacheService lateral
either http, socket.udp, or socket.tcp can set in config

Constructor Detail

LateralCache

protected LateralCache(ILateralCacheAttributes cattr,
                       ILateralCacheService lateral)
Constructor for the LateralCache object

Parameters:
cattr -
lateral -

LateralCache

protected LateralCache(ILateralCacheAttributes cattr)
Constructor for the LateralCache object

Parameters:
cattr -
Method Detail

toString

public java.lang.String toString()
Description of the Method


update

public void update(ICacheElement ce)
            throws java.io.IOException
Description of the Method

Specified by:
update in interface ICache
Throws:
java.io.IOException

get

public ICacheElement get(java.io.Serializable key)
                  throws java.io.IOException
Returns null. The performace costs are too great.

Specified by:
get in interface ICache
Throws:
java.io.IOException

getGroupKeys

public java.util.Set getGroupKeys(java.lang.String groupName)

remove

public boolean remove(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:
remove in interface ICache
Throws:
java.io.IOException

removeAll

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

Specified by:
removeAll in interface ICache
Throws:
java.io.IOException

dispose

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

Specified by:
dispose in interface ICache
Throws:
java.io.IOException

getStatus

public int getStatus()
Returns the cache status.

Specified by:
getStatus in interface ICache
Returns:
The status value

getSize

public int getSize()
Returns the current cache size.

Specified by:
getSize in interface ICache
Returns:
The size value

getCacheType

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

Specified by:
getCacheType in interface ICacheType
Returns:
The cacheType value

getCacheName

public java.lang.String getCacheName()
Gets the cacheName attribute of the LateralCache object

Specified by:
getCacheName in interface ICache
Returns:
The cacheName value

handleException

private void handleException(java.lang.Exception ex,
                             java.lang.String msg)
                      throws java.io.IOException
Not yet sure what to do here.

Throws:
java.io.IOException

fixCache

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