org.apache.jcs.auxiliary.remote
Class RemoteCacheManager

java.lang.Object
  extended byorg.apache.jcs.auxiliary.remote.RemoteCacheManager
All Implemented Interfaces:
AuxiliaryCacheManager, ICacheType, java.io.Serializable

public class RemoteCacheManager
extends java.lang.Object
implements AuxiliaryCacheManager

An instance of RemoteCacheManager corresponds to one remote connection of a specific host and port. All RemoteCacheManager instances are monitored by the singleton RemoteCacheMonitor monitoring daemon for error detection and recovery.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Method Summary
 void addRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener listener)
          Adds the remote cache listener to the underlying cache-watch service.
 void fixCaches(IRemoteCacheService remoteService, IRemoteCacheObserver remoteWatch)
          Fixes up all the caches managed by this cache manager.
 void freeCache(java.lang.String name)
          Description of the Method
 AuxiliaryCache getCache(IRemoteCacheAttributes cattr)
          Gets a RemoteCacheNoWait from the RemoteCacheManager.
 AuxiliaryCache getCache(java.lang.String cacheName)
          Returns a remote cache for the given cache name.
 int getCacheType()
          Gets the cacheType attribute of the RemoteCacheManager object
 IRemoteCacheAttributes getDefaultCattr()
          Gets the defaultCattr attribute of the RemoteCacheManager object
static RemoteCacheManager getInstance(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr)
          Returns an instance of RemoteCacheManager for the given connection parameters.
 java.lang.String getStats()
          Gets the stats attribute of the RemoteCacheManager object
 void release()
          Description of the Method
 void removeRemoteCacheListener(IRemoteCacheAttributes cattr)
           
 void removeRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener listener)
          Removes a listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultCattr

public IRemoteCacheAttributes getDefaultCattr()
Gets the defaultCattr attribute of the RemoteCacheManager object

Returns:
The defaultCattr value

addRemoteCacheListener

public void addRemoteCacheListener(IRemoteCacheAttributes cattr,
                                   IRemoteCacheListener listener)
                            throws java.io.IOException
Adds the remote cache listener to the underlying cache-watch service.

Parameters:
cattr - The feature to be added to the RemoteCacheListener attribute
listener - The feature to be added to the RemoteCacheListener attribute
Throws:
java.io.IOException

removeRemoteCacheListener

public void removeRemoteCacheListener(IRemoteCacheAttributes cattr,
                                      IRemoteCacheListener listener)
                               throws java.io.IOException
Removes a listener. When the primary recovers the failover must deregister itself for a region. The failover runner will call this method to de-register. We do not want to dergister all listeners to a remote server, in case a failover is a primary of another region. Having one regions failover act as another servers primary is not currently supported.

Parameters:
cattr -
listener -
Throws:
java.io.IOException

removeRemoteCacheListener

public void removeRemoteCacheListener(IRemoteCacheAttributes cattr)
                               throws java.io.IOException
Parameters:
cattr -
Throws:
java.io.IOException

getInstance

public static RemoteCacheManager getInstance(IRemoteCacheAttributes cattr,
                                             ICompositeCacheManager cacheMgr)
Returns an instance of RemoteCacheManager for the given connection parameters. Host and Port uniquely identify a manager instance. Also starts up the monitoring daemon, if not already started. If the connection cannot be established, zombie objects will be used for future recovery purposes.

Parameters:
cattr -
cacheMgr -
Returns:
The instance value

getCache

public AuxiliaryCache getCache(java.lang.String cacheName)
Returns a remote cache for the given cache name.

Specified by:
getCache in interface AuxiliaryCacheManager
Parameters:
cacheName -
Returns:
The cache value

getCache

public AuxiliaryCache getCache(IRemoteCacheAttributes cattr)
Gets a RemoteCacheNoWait from the RemoteCacheManager. The RemoteCacheNoWait objects are identified by the cache name value of the RemoteCacheAttributes object.

Parameters:
cattr -
Returns:
The cache value

freeCache

public void freeCache(java.lang.String name)
               throws java.io.IOException
Description of the Method

Parameters:
name -
Throws:
java.io.IOException

getStats

public java.lang.String getStats()
Gets the stats attribute of the RemoteCacheManager object

Returns:
The stats value

release

public void release()
Description of the Method


fixCaches

public void fixCaches(IRemoteCacheService remoteService,
                      IRemoteCacheObserver remoteWatch)
Fixes up all the caches managed by this cache manager.

Parameters:
remoteService -
remoteWatch -

getCacheType

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

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


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