ehcache

net.sf.ehcache.store
Class MemoryOnlyStore

java.lang.Object
  extended by net.sf.ehcache.store.AbstractStore
      extended by net.sf.ehcache.store.FrontEndCacheTier<NullStore,MemoryStore>
          extended by net.sf.ehcache.store.MemoryOnlyStore
All Implemented Interfaces:
Store

public final class MemoryOnlyStore
extends FrontEndCacheTier<NullStore,MemoryStore>

A memory-only store with support for all caching features.

Author:
Ludovic Orban

Field Summary
 
Fields inherited from class net.sf.ehcache.store.FrontEndCacheTier
authority, cache
 
Fields inherited from interface net.sf.ehcache.store.Store
CLUSTER_COHERENT, NODE_COHERENT
 
Method Summary
static Store create(Ehcache cache, Pool onHeapPool)
          Create an instance of MemoryStore
 Results executeQuery(StoreQuery query)
          Execute the given query on this store
 Policy getInMemoryEvictionPolicy()
          {inheritDoc}
 Object getMBean()
          Optional implementation specific MBean exposed by the store.
<T> Attribute<T>
getSearchAttribute(String attributeName)
          Retrieve the given named search attribute
 void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
          Inform this store of the configured attribute extractors.
 void setInMemoryEvictionPolicy(Policy policy)
          {inheritDoc}
 
Methods inherited from class net.sf.ehcache.store.FrontEndCacheTier
bufferFull, containsKey, containsKeyInMemory, containsKeyOffHeap, containsKeyOnDisk, copyElementForReadIfNeeded, copyElementForWriteIfNeeded, dispose, expireElements, flush, get, getAllLocks, getInMemorySize, getInMemorySizeInBytes, getInternalContext, getKeys, getLockFor, getOffHeapSize, getOffHeapSizeInBytes, getOnDiskSize, getOnDiskSizeInBytes, getQuiet, getSize, getStatus, getTerracottaClusteredSize, hasAbortedSizeOf, isCached, isEvictionCandidate, isPinned, notifyEvictionFromCache, put, putIfAbsent, putWithWriter, recalculateSize, remove, removeAll, removeElement, removeWithWriter, replace, replace, setPinned, unpinAll
 
Methods inherited from class net.sf.ehcache.store.AbstractStore
addStoreListener, getAll, getAllQuiet, getEventListenerList, isCacheCoherent, isClusterCoherent, isNodeCoherent, putAll, removeAll, removeStoreListener, setNodeCoherent, waitUntilClusterCoherent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Store create(Ehcache cache,
                           Pool onHeapPool)
Create an instance of MemoryStore

Parameters:
cache - the cache
onHeapPool - the on heap pool
Returns:
an instance of MemoryStore

setInMemoryEvictionPolicy

public void setInMemoryEvictionPolicy(Policy policy)
{inheritDoc}

Specified by:
setInMemoryEvictionPolicy in interface Store
Overrides:
setInMemoryEvictionPolicy in class FrontEndCacheTier<NullStore,MemoryStore>
Parameters:
policy - the new policy

getInMemoryEvictionPolicy

public Policy getInMemoryEvictionPolicy()
{inheritDoc}

Specified by:
getInMemoryEvictionPolicy in interface Store
Overrides:
getInMemoryEvictionPolicy in class FrontEndCacheTier<NullStore,MemoryStore>
Returns:
the current eviction policy. This may not be the configured policy, if it has been dynamically set.
See Also:
Store.setInMemoryEvictionPolicy(Policy)

setAttributeExtractors

public void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
Inform this store of the configured attribute extractors. Stores that will not invoke extractors are free to ignore this call

Specified by:
setAttributeExtractors in interface Store
Overrides:
setAttributeExtractors in class AbstractStore

executeQuery

public Results executeQuery(StoreQuery query)
Execute the given query on this store

Specified by:
executeQuery in interface Store
Overrides:
executeQuery in class AbstractStore
Parameters:
query - query to execute
Returns:
query results

getSearchAttribute

public <T> Attribute<T> getSearchAttribute(String attributeName)
                                throws CacheException
Retrieve the given named search attribute

Specified by:
getSearchAttribute in interface Store
Overrides:
getSearchAttribute in class AbstractStore
Type Parameters:
T - type of the attribute
Parameters:
attributeName - the name of the attribute to retrieve
Returns:
the search attribute or null if non-existent
Throws:
CacheException

getMBean

public Object getMBean()
Optional implementation specific MBean exposed by the store.

Returns:
implementation specific management bean

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.