|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.auxiliary.remote.RemoteCacheNoWait
public class RemoteCacheNoWait
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.
Typically errors will be handled down stream. We only need to kill the queue if an error makes it to this level from the queue. That can only happen if the queue is damaged, since the events are procesed asynchronously.
There is no reason to create a queue on startup if the remote is not healthy.
If the remote cache encounters an error it will zombie--create a blaking facade for the service. The Zombie will queue up items until the conenction is restored. An alternative way to accomplish the same thing would be to stop, not destroy the queue at this level. That way items would be added to the queue and then when the connection is restored, we could start the worker threads again. This is a better long term solution, but it requires some significnat changes to the complicated worker queues.
| Field Summary |
|---|
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
|---|
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
| Constructor Summary | |
|---|---|
RemoteCacheNoWait(IRemoteCacheClient 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. |
AuxiliaryCacheAttributes |
getAuxiliaryCacheAttributes()
This returns the generic attributes for an auxiliary cache. |
protected ICacheEventQueue |
getCacheEventQueue()
This is for testing only. |
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 |
protected IRemoteCacheClient |
getRemoteCache()
This is temporary. |
int |
getSize()
No remote invocation. |
IStats |
getStatistics()
Returns the historical and statistical data for a region's auxiliary cache. |
java.lang.String |
getStats()
Returns the statistics in String form. |
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()
Returns the stats and the cache.toString(). |
void |
update(ICacheElement ce)
Adds a put event to the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteCacheNoWait(IRemoteCacheClient cache)
cache - | Method Detail |
|---|
public void update(ICacheElement ce)
throws java.io.IOException
(non-Javadoc)
update in interface AuxiliaryCacheupdate in interface ICachejava.io.IOExceptionICache.update(org.apache.jcs.engine.behavior.ICacheElement)
public ICacheElement get(java.io.Serializable key)
throws java.io.IOException
get in interface AuxiliaryCacheget in interface ICachekey -
java.io.IOException
public java.util.Set getGroupKeys(java.lang.String groupName)
throws java.io.IOException
AuxiliaryCache
getGroupKeys in interface AuxiliaryCachejava.io.IOException
public boolean remove(java.io.Serializable key)
throws java.io.IOException
remove in interface AuxiliaryCacheremove in interface ICachekey -
java.io.IOException
public void removeAll()
throws java.io.IOException
removeAll in interface AuxiliaryCacheremoveAll in interface ICachejava.io.IOExceptionpublic void dispose()
dispose in interface AuxiliaryCachedispose in interface ICachepublic int getSize()
getSize in interface AuxiliaryCachegetSize in interface ICachepublic int getCacheType()
getCacheType in interface ICacheTypepublic int getStatus()
getStatus in interface AuxiliaryCachegetStatus in interface ICachepublic java.lang.String getCacheName()
getCacheName in interface AuxiliaryCachegetCacheName in interface ICachepublic void fixCache(IRemoteCacheService remote)
remote - public void resetEventQ()
There may be no good reason to kill the existing queue. We will sometimes need to set a new listener id, so we should create a new queue. We should let the old queue drain. If we were conencted to the failover, it would be best to finish sending items.
protected IRemoteCacheClient getRemoteCache()
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
AuxiliaryCache
getAuxiliaryCacheAttributes in interface AuxiliaryCacheprotected ICacheEventQueue getCacheEventQueue()
public java.lang.String toString()
(non-Javadoc)
toString in class java.lang.ObjectObject.toString()public java.lang.String getStats()
getStats in interface ICachepublic IStats getStatistics()
AuxiliaryCache
getStatistics in interface AuxiliaryCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||