Oracle® Coherence Java API Reference
v3.5

E14977-01

com.tangosol.net.cache
Class CacheLoaderCacheStore

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.cache.AbstractCacheLoader
          extended by com.tangosol.net.cache.AbstractCacheStore
              extended by com.tangosol.net.cache.CacheLoaderCacheStore
All Implemented Interfaces:
CacheLoader, CacheStore
Direct Known Subclasses:
CacheLoaderCacheStore.Iterable

public class CacheLoaderCacheStore
extends AbstractCacheStore

A read-only CacheStore that wraps a CacheLoader.

Since:
Coherence 3.2
Author:
cp 2006.09.06

Nested Class Summary
static class CacheLoaderCacheStore.Iterable
          An extension to the CacheLoaderCacheStore that implements the IterableCacheLoader interface.
 
Field Summary
protected  CacheLoader m_loader
          The CacheLoader to delegate to.
 
Constructor Summary
CacheLoaderCacheStore(CacheLoader loader)
          The CacheLoader to delegate to.
 
Method Summary
 java.lang.Object load(java.lang.Object oKey)
          Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
 java.util.Map loadAll(java.util.Collection colKeys)
          Return the values associated with each the specified keys in the passed collection.
static CacheStore wrapCacheLoader(CacheLoader loader)
          Create a CacheStore wrapper for the passed CacheLoader.
 
Methods inherited from class com.tangosol.net.cache.AbstractCacheStore
erase, eraseAll, store, storeAll
 

Field Detail

m_loader

protected CacheLoader m_loader
The CacheLoader to delegate to.

Constructor Detail

CacheLoaderCacheStore

public CacheLoaderCacheStore(CacheLoader loader)
The CacheLoader to delegate to.

Method Detail

wrapCacheLoader

public static CacheStore wrapCacheLoader(CacheLoader loader)
Create a CacheStore wrapper for the passed CacheLoader. Note that the returned CacheStore will implement the IterableCacheLoader interface if and only if the passed CacheLoader implements it.

Parameters:
loader - the CacheLoader to wrap
Returns:
a CacheStore

load

public java.lang.Object load(java.lang.Object oKey)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.

Specified by:
load in interface CacheLoader
Specified by:
load in class AbstractCacheLoader
Parameters:
oKey - key whose associated value is to be returned
Returns:
the value associated with the specified key, or null if no value is available for that key

loadAll

public java.util.Map loadAll(java.util.Collection colKeys)
Return the values associated with each the specified keys in the passed collection. If a key does not have an associated value in the underlying store, then the return map will not have an entry for that key.

Specified by:
loadAll in interface CacheLoader
Overrides:
loadAll in class AbstractCacheLoader
Parameters:
colKeys - a collection of keys to load
Returns:
a Map of keys to associated values for the specified keys

Oracle® Coherence Java API Reference
v3.5

E14977-01

Copyright © 2000, 2009, Oracle. All rights reserved.