org.apache.jcs.auxiliary.remote
Class RemoteCacheNoWait

java.lang.Object
  extended byorg.apache.jcs.auxiliary.remote.RemoteCacheNoWait
All Implemented Interfaces:
AuxiliaryCache, ICache, ICacheType, java.io.Serializable

public class RemoteCacheNoWait
extends java.lang.Object
implements AuxiliaryCache

Used to queue up update requests to the underlying cache. These requests will be processed in their order of arrival via the cache event queue processor.

Author:
asmuts
See Also:
Serialized Form

Field Summary
private  RemoteCache cache
           
private static org.apache.commons.logging.Log log
           
private  ICacheEventQueue q
           
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
RemoteCacheNoWait(RemoteCache cache)
          Constructs with the given remote cache, and fires up an event queue for aysnchronous processing.
 
Method Summary
 void dispose()
          Adds a dispose request to the remote cache.
 void fixCache(IRemoteCacheService remote)
          Replaces the remote cache service handle with the given handle and reset the event queue by starting up a new instance.
 ICacheElement get(java.io.Serializable key)
          Synchronously reads from the remote cache.
 java.lang.String getCacheName()
          Gets the cacheName attribute of the RemoteCacheNoWait object
 int getCacheType()
          No remote invokation.
 java.util.Set getGroupKeys(java.lang.String groupName)
          Gets the set of keys of objects currently in the group
 int getSize()
          No remote invokation.
 int getStatus()
          Returns the asyn cache status.
 boolean remove(java.io.Serializable key)
          Adds a remove request to the remote cache.
 void removeAll()
          Adds a removeAll request to the remote cache.
 void resetEventQ()
          Resets the event q by first destroying the existing one and starting up new one.
 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

cache

private final RemoteCache cache

q

private ICacheEventQueue q
Constructor Detail

RemoteCacheNoWait

public RemoteCacheNoWait(RemoteCache cache)
Constructs with the given remote cache, and fires up an event queue for aysnchronous processing.

Parameters:
cache -
Method Detail

update

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

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

get

public ICacheElement get(java.io.Serializable key)
                  throws java.io.IOException
Synchronously reads from the remote cache.

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

getGroupKeys

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

Specified by:
getGroupKeys in interface AuxiliaryCache
Throws:
java.io.IOException

remove

public boolean remove(java.io.Serializable key)
               throws java.io.IOException
Adds a remove request to the remote cache.

Specified by:
remove in interface AuxiliaryCache
Throws:
java.io.IOException

removeAll

public void removeAll()
               throws java.io.IOException
Adds a removeAll request to the remote cache.

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

dispose

public void dispose()
Adds a dispose request to the remote cache.

Specified by:
dispose in interface AuxiliaryCache

getSize

public int getSize()
No remote invokation.

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

getCacheType

public int getCacheType()
No remote invokation.

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

getStatus

public int getStatus()
Returns the asyn cache status. An error status indicates either the remote connection is not available, or the asyn queue has been unexpectedly destroyed. No remote invokation.

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

getCacheName

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

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

fixCache

public void fixCache(IRemoteCacheService remote)
Replaces the remote cache service handle with the given handle and reset the event queue by starting up a new instance.


resetEventQ

public void resetEventQ()
Resets the event q by first destroying the existing one and starting up new one.


toString

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