org.apache.jcs.auxiliary.remote
Class RemoteCache

java.lang.Object
  extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCache
      extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging
          extended by org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache
              extended by org.apache.jcs.auxiliary.remote.RemoteCache
All Implemented Interfaces:
java.io.Serializable, AuxiliaryCache, IRemoteCacheClient, ICache, ICacheType

public class RemoteCache
extends AbstractRemoteAuxiliaryCache

Client proxy for an RMI remote cache.

This handles gets, updates, and removes. It also initiates failover recovery when an error is encountered.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache
cacheName
 
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
RemoteCache(IRemoteCacheAttributes cattr, IRemoteCacheService remote, IRemoteCacheListener listener)
          Constructor for the RemoteCache object.
 
Method Summary
 java.lang.String getEventLoggingExtraInfo()
          Gets the extra info for the event log.
protected  java.lang.String getIPAddressForService()
          IP address for the service, if one is stored.
 IStats getStatistics()
           
protected  void handleException(java.lang.Exception ex, java.lang.String msg, java.lang.String eventName)
          Handles exception by disabling the remote cache service before re-throwing the exception in the form of an IOException.
 java.lang.String toString()
          Debugging info.
 
Methods inherited from class org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache
fixCache, getAuxiliaryCacheAttributes, getCacheName, getCacheType, getGroupKeys, getListener, getListenerId, getRemoteCacheAttributes, getRemoteCacheListener, getRemoteCacheService, getSize, getStats, getStatus, getUsingPool, processDispose, processGet, processGetMatching, processGetMultiple, processRemove, processRemoveAll, processUpdate, setListenerId, setRemoteCacheAttributes, setRemoteCacheListener, setRemoteCacheService
 
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLogging
 
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
 
Methods inherited from interface org.apache.jcs.auxiliary.AuxiliaryCache
setCacheEventLogger, setElementSerializer
 
Methods inherited from interface org.apache.jcs.engine.behavior.ICache
dispose, get, getMatching, getMultiple, remove, removeAll, setKeyMatcher, update
 

Constructor Detail

RemoteCache

public RemoteCache(IRemoteCacheAttributes cattr,
                   IRemoteCacheService remote,
                   IRemoteCacheListener listener)
Constructor for the RemoteCache object. This object communicates with a remote cache server. One of these exists for each region. This also holds a reference to a listener. The same listener is used for all regions for one remote server. Holding a reference to the listener allows this object to know the listener id assigned by the remote cache.

Parameters:
cattr -
remote -
listener -
Method Detail

getStatistics

public IStats getStatistics()
Specified by:
getStatistics in interface AuxiliaryCache
Overrides:
getStatistics in class AbstractRemoteAuxiliaryCache
Returns:
IStats object

handleException

protected void handleException(java.lang.Exception ex,
                               java.lang.String msg,
                               java.lang.String eventName)
                        throws java.io.IOException
Handles exception by disabling the remote cache service before re-throwing the exception in the form of an IOException.

Specified by:
handleException in class AbstractRemoteAuxiliaryCache
Parameters:
ex -
msg -
eventName -
Throws:
java.io.IOException

toString

public java.lang.String toString()
Debugging info.

Overrides:
toString in class java.lang.Object
Returns:
basic info about the RemoteCache

getEventLoggingExtraInfo

public java.lang.String getEventLoggingExtraInfo()
Gets the extra info for the event log.

Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache
Returns:
disk location

getIPAddressForService

protected java.lang.String getIPAddressForService()
IP address for the service, if one is stored.

Protected for testing.

Returns:
String


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