org.apache.jcs.auxiliary.remote
Class RemoteCacheNoWaitFacade

java.lang.Object
  extended by org.apache.jcs.auxiliary.remote.RemoteCacheNoWaitFacade
All Implemented Interfaces:
java.io.Serializable, AuxiliaryCache, ICache, ICacheType

public class RemoteCacheNoWaitFacade
extends java.lang.Object
implements AuxiliaryCache

Used to provide access to multiple services under nowait protection. Factory should construct NoWaitFacade to give to the composite cache out of caches it constructs from the varies manager to lateral services.

Typically, we only connect to one remote server per facade. We use a list of one RemoteCacheNoWait.

See Also:
Serialized Form

Field Summary
 RemoteCacheNoWait[] noWaits
          The connection to a remote server, or a zombie.
protected  RemoteCacheAttributes remoteCacheAttributes
          holds failover and cluster information
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
RemoteCacheNoWaitFacade(RemoteCacheNoWait[] noWaits, RemoteCacheAttributes rca, ICompositeCacheManager cacheMgr)
          Constructs with the given remote cache, and fires events to any listeners.
 
Method Summary
 void dispose()
          Adds a dispose request to the lateral cache.
protected  void failover(int i)
          Begin the failover process if this is a local cache.
 ICacheElement get(java.io.Serializable key)
          Synchronously reads from the remote cache.
 AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
          This returns the generic attributes for an auxiliary cache.
 java.lang.String getCacheName()
          Gets the cacheName attribute of the RemoteCacheNoWaitFacade object.
 int getCacheType()
          Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.
 java.util.Set getGroupKeys(java.lang.String group)
          Gets the set of keys of objects currently in the group.
 RemoteCacheAttributes getRemoteCacheAttributes()
          Gets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object
 int getSize()
          No lateral invocation.
 IStats getStatistics()
          Returns the historical and statistical data for a region's auxiliary cache.
 java.lang.String getStats()
          getStats
 int getStatus()
          Gets the status attribute of the RemoteCacheNoWaitFacade object Return ALIVE if any are alive.
 boolean remove(java.io.Serializable key)
          Adds a remove request to the remote cache.
 void removeAll()
          Adds a removeAll request to the lateral cache.
 void setRemoteCacheAttributes(RemoteCacheAttributes rca)
          Sets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object.
 java.lang.String toString()
          String form of some of the configuratin information for the remote cache.
 void update(ICacheElement ce)
          Put an element in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noWaits

public RemoteCacheNoWait[] noWaits
The connection to a remote server, or a zombie.


remoteCacheAttributes

protected RemoteCacheAttributes remoteCacheAttributes
holds failover and cluster information

Constructor Detail

RemoteCacheNoWaitFacade

public RemoteCacheNoWaitFacade(RemoteCacheNoWait[] noWaits,
                               RemoteCacheAttributes rca,
                               ICompositeCacheManager cacheMgr)
Constructs with the given remote cache, and fires events to any listeners.

Parameters:
noWaits -
rca -
cacheMgr -
Method Detail

getRemoteCacheAttributes

public RemoteCacheAttributes getRemoteCacheAttributes()
Gets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object

Returns:
The remoteCacheAttributes value

setRemoteCacheAttributes

public void setRemoteCacheAttributes(RemoteCacheAttributes rca)
Sets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object.

Parameters:
rca - The new remoteCacheAttributes value

update

public void update(ICacheElement ce)
            throws java.io.IOException
Put an element in the cache.

Specified by:
update in interface AuxiliaryCache
Specified by:
update in interface ICache
Parameters:
ce -
Throws:
java.io.IOException

get

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

Specified by:
get in interface AuxiliaryCache
Specified by:
get in interface ICache
Parameters:
key -
Returns:
Either an ICacheElement or null if it is not found.

getGroupKeys

public java.util.Set getGroupKeys(java.lang.String group)
                           throws java.io.IOException
Gets the set of keys of objects currently in the group.

Specified by:
getGroupKeys in interface AuxiliaryCache
Parameters:
group -
Returns:
Throws:
java.io.IOException

remove

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

Specified by:
remove in interface AuxiliaryCache
Specified by:
remove in interface ICache
Parameters:
key -
Returns:
wether or not it was removed, right now it return false.

removeAll

public void removeAll()
Adds a removeAll request to the lateral cache.

Specified by:
removeAll in interface AuxiliaryCache
Specified by:
removeAll in interface ICache

dispose

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

Specified by:
dispose in interface AuxiliaryCache
Specified by:
dispose in interface ICache

getSize

public int getSize()
No lateral invocation.

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

getCacheType

public int getCacheType()
Gets the cacheType attribute of the RemoteCacheNoWaitFacade object.

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

getCacheName

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

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

getStatus

public int getStatus()
Gets the status attribute of the RemoteCacheNoWaitFacade object

Return ALIVE if any are alive.

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

toString

public java.lang.String toString()
String form of some of the configuratin information for the remote cache.

Overrides:
toString in class java.lang.Object
Returns:
Some info for logging.

failover

protected void failover(int i)
Begin the failover process if this is a local cache. Clustered remote caches do not failover.

Parameters:
i - The no wait in error.

getAuxiliaryCacheAttributes

public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
Description copied from interface: AuxiliaryCache
This returns the generic attributes for an auxiliary cache. Most implementations will cast this to a more specific type.

Specified by:
getAuxiliaryCacheAttributes in interface AuxiliaryCache
Returns:
Returns the AuxiliaryCacheAttributes.

getStats

public java.lang.String getStats()
getStats

Specified by:
getStats in interface ICache
Returns:
String

getStatistics

public IStats getStatistics()
Description copied from interface: AuxiliaryCache
Returns the historical and statistical data for a region's auxiliary cache.

Specified by:
getStatistics in interface AuxiliaryCache
Returns:


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