org.apache.jcs.auxiliary.remote
Class AbstractRemoteCacheNoWaitFacade

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

public abstract class AbstractRemoteCacheNoWaitFacade
extends AbstractAuxiliaryCache

An abstract base for the No Wait Facade. Different implmentations will failover differently.

See Also:
Serialized Form

Field Summary
 RemoteCacheNoWait[] noWaits
          The connection to a remote server, or a zombie.
protected  IRemoteCacheAttributes remoteCacheAttributes
          holds failover and cluster information
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
AbstractRemoteCacheNoWaitFacade(RemoteCacheNoWait[] noWaits, RemoteCacheAttributes rca, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
          Constructs with the given remote cache, and fires events to any listeners.
 
Method Summary
 void dispose()
          Adds a dispose request to the remote 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.
protected  ICompositeCacheManager getCompositeCacheManager()
           
 java.lang.String getEventLoggingExtraInfo()
          This typically returns end point info .
 java.util.Set getGroupKeys(java.lang.String group)
          Gets the set of keys of objects currently in the group.
 java.util.Map getMatching(java.lang.String pattern)
          Synchronously read from the remote cache.
 java.util.Map getMultiple(java.util.Set keys)
          Gets multiple items from the cache based on the given set of keys.
 IRemoteCacheAttributes getRemoteCacheAttributes()
          Gets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object
 int getSize()
          No remote invocation.
 IStats getStatistics()
           
 java.lang.String getStats()
          getStats
 int getStatus()
          Gets the status attribute of the RemoteCacheNoWaitFacade object
 boolean remove(java.io.Serializable key)
          Adds a remove request to the remote cache.
 void removeAll()
          Adds a removeAll request to the remote cache.
protected  void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
           
 void setRemoteCacheAttributes(IRemoteCacheAttributes rca)
          Sets the remoteCacheAttributes attribute of the RemoteCacheNoWaitFacade object.
 java.lang.String toString()
          String form of some of the configuration information for the remote cache.
 void update(ICacheElement ce)
          Put an element in the cache.
 
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher
 
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 IRemoteCacheAttributes remoteCacheAttributes
holds failover and cluster information

Constructor Detail

AbstractRemoteCacheNoWaitFacade

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

Parameters:
noWaits -
rca -
cacheMgr -
cacheEventLogger -
elementSerializer -
Method Detail

update

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

Parameters:
ce -
Throws:
java.io.IOException

get

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

Parameters:
key -
Returns:
Either an ICacheElement or null if it is not found.

getMatching

public java.util.Map getMatching(java.lang.String pattern)
                          throws java.io.IOException
Synchronously read from the remote cache.

Parameters:
pattern -
Returns:
map
Throws:
java.io.IOException

getMultiple

public java.util.Map getMultiple(java.util.Set keys)
Gets multiple items from the cache based on the given set of keys.

Parameters:
keys -
Returns:
a map of Serializable key to ICacheElement element, or an empty map if there is no data in cache for any of these keys

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.

Parameters:
group -
Returns:
the set of keys of objects currently in the group
Throws:
java.io.IOException

remove

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

Parameters:
key -
Returns:
whether or not it was removed, right now it return false.

removeAll

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


dispose

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


getSize

public int getSize()
No remote invocation.

Returns:
The size value

getCacheType

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

Returns:
The cacheType value

getCacheName

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

Returns:
The cacheName value

getStatus

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

Return ALIVE if any are alive.

Returns:
The status value

toString

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

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

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.

Returns:
Returns the AuxiliaryCacheAttributes.

getStats

public java.lang.String getStats()
getStats

Returns:
String

getStatistics

public IStats getStatistics()
Returns:
statistics about the cache region

getEventLoggingExtraInfo

public java.lang.String getEventLoggingExtraInfo()
This typically returns end point info .

Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache
Returns:
the name

getRemoteCacheAttributes

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

Returns:
The remoteCacheAttributes value

setRemoteCacheAttributes

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

Parameters:
rca - The new remoteCacheAttributes value

setCompositeCacheManager

protected void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
Parameters:
compositeCacheManager - the compositeCacheManager to set

getCompositeCacheManager

protected ICompositeCacheManager getCompositeCacheManager()
Returns:
the compositeCacheManager


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