org.infinispan.loaders
Class AbstractCacheLoader
java.lang.Object
org.infinispan.loaders.AbstractCacheLoader
- All Implemented Interfaces:
- CacheLoader
- Direct Known Subclasses:
- AbstractCacheStore, ClusterCacheLoader
public abstract class AbstractCacheLoader
- extends Object
- implements CacheLoader
An abstract CacheLoader
that holds common implementations for some methods
- Since:
- 4.0
- Author:
- Manik Surtani, Mircea.Markus@jboss.com
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
marshaller
protected volatile StreamingMarshaller marshaller
cache
protected volatile Cache cache
AbstractCacheLoader
public AbstractCacheLoader()
containsKey
public boolean containsKey(Object key)
throws CacheLoaderException
- This implementation delegates to
CacheLoader.load(Object)
, to ensure that a response is
returned only if the entry is not expired.
- Specified by:
containsKey
in interface CacheLoader
- Parameters:
key
- key to test
- Returns:
- true if the key exists, false otherwise
- Throws:
CacheLoaderException
- in the event of problems reading from source
init
public void init(CacheLoaderConfig config,
Cache<?,?> cache,
StreamingMarshaller m)
throws CacheLoaderException
- Description copied from interface:
CacheLoader
- Used to initialize a cache loader. Typically invoked by the
CacheLoaderManager
when setting up cache loaders.
- Specified by:
init
in interface CacheLoader
- Parameters:
config
- the cache loader configuration beancache
- cache associated with this cache loader. Implementations may use this to determine cache name when
selecting where refer to state in storage, for example, a different database table name.m
- marshaller to use when loading state from a stream, if supported by the implementation.
- Throws:
CacheLoaderException
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.