com.caucho.server.distcache
Class CacheStoreManager

java.lang.Object
  extended by com.caucho.server.distcache.CacheStoreManager
All Implemented Interfaces:
CacheEntryFactory

@Module
public final class CacheStoreManager
extends java.lang.Object
implements CacheEntryFactory

Manages the distributed cache


Constructor Summary
CacheStoreManager(ResinSystem resinSystem)
           
 
Method Summary
 void addCacheConfig(byte[] cacheHash, CacheConfig config)
           
 void addCacheListener(HashKey cacheKey, CacheMnodeListener listener)
           
 long calculateValueHash(java.lang.Object value, CacheConfig config)
           
 void clearEphemeralEntries()
          Clears ephemeral data on startup.
 void clearLeases()
          Clears leases on server start/stop
 void close()
          Closes the manager.
 void closeCache(java.lang.String guid, HashKey cacheKey)
           
 DistCacheEntry createCacheEntry(HashKey hashKey, CacheHandle cache)
          Returns the key entry.
 void destroyCache(CacheImpl cache)
          Called when a cache is removed.
 CacheHandle getCache(HashKey cacheHash)
           
 CacheHandle getCache(java.lang.String guid, CacheSerializer keySerializer)
          Returns the CacheHandle.
 CacheConfig getCacheConfig(byte[] cacheHash)
           
 CacheEngine getCacheEngine()
           
 DistCacheEntry getCacheEntry(HashKey key)
          Returns the key entry.
 DistCacheEntry getCacheEntry(HashKey key, CacheHandle cache)
          Returns the key entry.
 DistCacheEntry getCacheEntry(HashKey key, HashKey cacheKey)
          Returns the key entry.
 DistCacheEntry getCacheEntry(HashKey hashKey, HashKey cacheKey, java.lang.Object oKey)
          Returns the key entry.
 DistCacheEntry getCacheEntry(java.lang.Object key, CacheConfig config)
          Returns the key entry.
 CacheEntryManager getCacheEntryManager()
           
 CacheDataBacking getDataBacking()
           
 DataStore getDataStore()
           
 CacheConfig getDefaultCacheConfig()
           
 java.util.Iterator<DistCacheEntry> getEntries()
           
 CacheKeyManager getKeyManager()
           
 LocalDataManager getLocalDataManager()
           
 com.caucho.server.distcache.LocalMnodeManager getLocalMnodeManager()
           
 LocalStoreManager getLocalStoreManager()
           
 MnodeStore getMnodeStore()
           
 void initCache(CacheImpl cache)
          Called when a cache initializes.
 boolean isClosed()
           
 DistCacheEntry loadLocalEntry(HashKey key, CacheConfig config)
           
 DistCacheEntry loadLocalEntry(HashKey key, HashKey cacheKey)
           
 MnodeUpdate localPut(byte[] keyHash, MnodeUpdate update, StreamSource source)
          localPut updates the local copy based on a CachePut message
 void saveLocalUpdateTime(HashKey key, long version, long accessTimeout, long lastAccessTime)
          Sets a cache entry
 void setCacheEngine(CacheEngine cacheEngine)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheStoreManager

public CacheStoreManager(ResinSystem resinSystem)
Method Detail

getCacheEntryManager

public final CacheEntryManager getCacheEntryManager()

setCacheEngine

public void setCacheEngine(CacheEngine cacheEngine)

getCacheEngine

public CacheEngine getCacheEngine()

getDataBacking

public CacheDataBacking getDataBacking()

getLocalMnodeManager

public com.caucho.server.distcache.LocalMnodeManager getLocalMnodeManager()

getLocalDataManager

public LocalDataManager getLocalDataManager()

getLocalStoreManager

public LocalStoreManager getLocalStoreManager()

getKeyManager

public CacheKeyManager getKeyManager()

getDefaultCacheConfig

public final CacheConfig getDefaultCacheConfig()

addCacheListener

public void addCacheListener(HashKey cacheKey,
                             CacheMnodeListener listener)

getCacheEntry

public final DistCacheEntry getCacheEntry(java.lang.Object key,
                                          CacheConfig config)
Returns the key entry.


getCacheEntry

public final DistCacheEntry getCacheEntry(HashKey key)
Returns the key entry.


getCacheEntry

public final DistCacheEntry getCacheEntry(HashKey hashKey,
                                          HashKey cacheKey,
                                          java.lang.Object oKey)
Returns the key entry.


getCacheEntry

public final DistCacheEntry getCacheEntry(HashKey key,
                                          HashKey cacheKey)
Returns the key entry.


getCacheEntry

public final DistCacheEntry getCacheEntry(HashKey key,
                                          CacheHandle cache)
Returns the key entry.


createCacheEntry

public DistCacheEntry createCacheEntry(HashKey hashKey,
                                       CacheHandle cache)
Returns the key entry.

Specified by:
createCacheEntry in interface CacheEntryFactory

getCache

public final CacheHandle getCache(java.lang.String guid,
                                  CacheSerializer keySerializer)
Returns the CacheHandle.


getCache

public final CacheHandle getCache(HashKey cacheHash)

loadLocalEntry

public final DistCacheEntry loadLocalEntry(HashKey key,
                                           CacheConfig config)

loadLocalEntry

public final DistCacheEntry loadLocalEntry(HashKey key,
                                           HashKey cacheKey)

saveLocalUpdateTime

public final void saveLocalUpdateTime(HashKey key,
                                      long version,
                                      long accessTimeout,
                                      long lastAccessTime)
Sets a cache entry


localPut

public MnodeUpdate localPut(byte[] keyHash,
                            MnodeUpdate update,
                            StreamSource source)
localPut updates the local copy based on a CachePut message


clearLeases

public final void clearLeases()
Clears leases on server start/stop


clearEphemeralEntries

public void clearEphemeralEntries()
Clears ephemeral data on startup.


getEntries

public java.util.Iterator<DistCacheEntry> getEntries()

start

public void start()

stop

public void stop()

closeCache

public void closeCache(java.lang.String guid,
                       HashKey cacheKey)

initCache

public void initCache(CacheImpl cache)
Called when a cache initializes.


destroyCache

public void destroyCache(CacheImpl cache)
Called when a cache is removed.


addCacheConfig

public void addCacheConfig(byte[] cacheHash,
                           CacheConfig config)

getCacheConfig

public CacheConfig getCacheConfig(byte[] cacheHash)
Parameters:
cacheHash -
Returns:

close

public void close()
Closes the manager.


isClosed

public boolean isClosed()

calculateValueHash

public long calculateValueHash(java.lang.Object value,
                               CacheConfig config)

getMnodeStore

public MnodeStore getMnodeStore()

getDataStore

public DataStore getDataStore()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object