org.yestech.cache.impl
Class TerracottaDistributedCacheManager<K,V>

java.lang.Object
  extended by org.yestech.cache.impl.TerracottaDistributedCacheManager<K,V>
All Implemented Interfaces:
ICacheManager<K,V>

public class TerracottaDistributedCacheManager<K,V>
extends Object
implements ICacheManager<K,V>

ICacheManager that allows access to Terracotta DistributedCache

Version:
$Revision: $
Author:
Artie Copeland

Constructor Summary
TerracottaDistributedCacheManager()
           
 
Method Summary
 boolean contains(K k)
          Checks is a Key is present in the cache.
 void flush(K key)
          Flush the Value associated with the Key from the Cache
 void flushAll()
          Flushes the entire cache
 V get(K key)
          Return the Value associated with the Key
 int getMaxTTIInSeconds()
           
 int getMaxTTLInSeconds()
           
 String getName()
           
 long getOrphanEvictionFrequency()
           
 int getTargetMaxInMemoryCount()
           
 int getTargetMaxTotalCount()
           
 boolean isEnableLogging()
           
 boolean isOrphanEvictionEnabled()
           
 Collection<K> keys()
          Returns all the Keys found in the Cache.
 void load()
          Loads a cache from some type of durable storage.
 void put(K k, V v)
          Puts a Key/Value into the cache, overriding any value the might already be associated with the Key.
 void put(org.yestech.lib.util.Pair<K,V> entry)
          Puts a Key/Value into the cache, overriding any value the might already be associated with the Key.
 void putAll(Map<K,V> collection)
          Puts a Collection of Key/Value Pairs into the cache.
 void setEnableLogging(boolean enableLogging)
           
 void setMaxTTIInSeconds(int maxTTIInSeconds)
           
 void setMaxTTLInSeconds(int maxTTLInSeconds)
           
 void setName(String name)
           
 void setOrphanEvictionEnabled(boolean orphanEvictionEnabled)
           
 void setOrphanEvictionFrequency(int orphanEvictionFrequency)
           
 void setTargetMaxInMemoryCount(int targetMaxInMemoryCount)
           
 void setTargetMaxTotalCount(int targetMaxTotalCount)
           
 void start()
           
 void stop()
           
 void store()
          Stores a cache to some type of durable storage.
 Collection<V> values()
          Returns all the values stored in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerracottaDistributedCacheManager

public TerracottaDistributedCacheManager()
Method Detail

start

@PostConstruct
public void start()

stop

@PreDestroy
public void stop()

getName

public String getName()

setName

public void setName(String name)

getTargetMaxInMemoryCount

public int getTargetMaxInMemoryCount()

setTargetMaxInMemoryCount

public void setTargetMaxInMemoryCount(int targetMaxInMemoryCount)

getTargetMaxTotalCount

public int getTargetMaxTotalCount()

setTargetMaxTotalCount

public void setTargetMaxTotalCount(int targetMaxTotalCount)

getOrphanEvictionFrequency

public long getOrphanEvictionFrequency()

setOrphanEvictionFrequency

public void setOrphanEvictionFrequency(int orphanEvictionFrequency)

isOrphanEvictionEnabled

public boolean isOrphanEvictionEnabled()

setOrphanEvictionEnabled

public void setOrphanEvictionEnabled(boolean orphanEvictionEnabled)

isEnableLogging

public boolean isEnableLogging()

setEnableLogging

public void setEnableLogging(boolean enableLogging)

getMaxTTIInSeconds

public int getMaxTTIInSeconds()

setMaxTTIInSeconds

public void setMaxTTIInSeconds(int maxTTIInSeconds)

getMaxTTLInSeconds

public int getMaxTTLInSeconds()

setMaxTTLInSeconds

public void setMaxTTLInSeconds(int maxTTLInSeconds)

contains

public boolean contains(K k)
Description copied from interface: ICacheManager
Checks is a Key is present in the cache.

Specified by:
contains in interface ICacheManager<K,V>
Parameters:
k - the Key to check
Returns:
true if present, else false

putAll

public void putAll(Map<K,V> collection)
Description copied from interface: ICacheManager
Puts a Collection of Key/Value Pairs into the cache.

Specified by:
putAll in interface ICacheManager<K,V>
Parameters:
collection - Collection of Keys/Values to add

put

public void put(org.yestech.lib.util.Pair<K,V> entry)
Description copied from interface: ICacheManager
Puts a Key/Value into the cache, overriding any value the might already be associated with the Key.

Specified by:
put in interface ICacheManager<K,V>
Parameters:
entry - Key and Value pair to add (Key is Pair.getFirst() and Value is Pair.getSecond().

put

public void put(K k,
                V v)
Description copied from interface: ICacheManager
Puts a Key/Value into the cache, overriding any value the might already be associated with the Key.

Specified by:
put in interface ICacheManager<K,V>
Parameters:
k - Key that the value will be associated by
v - Value to be cached

get

public V get(K key)
Description copied from interface: ICacheManager
Return the Value associated with the Key

Specified by:
get in interface ICacheManager<K,V>
Parameters:
key - Key to lookup
Returns:
The value, else null if no value is associated with the Key or the Key is not found

flushAll

public void flushAll()
Description copied from interface: ICacheManager
Flushes the entire cache

Specified by:
flushAll in interface ICacheManager<K,V>

flush

public void flush(K key)
Description copied from interface: ICacheManager
Flush the Value associated with the Key from the Cache

Specified by:
flush in interface ICacheManager<K,V>
Parameters:
key - Key to flush

keys

public Collection<K> keys()
Description copied from interface: ICacheManager
Returns all the Keys found in the Cache. Depending on the Concrete cache duplicates might be possible.

Specified by:
keys in interface ICacheManager<K,V>
Returns:
All the keys as a collection

values

public Collection<V> values()
Description copied from interface: ICacheManager
Returns all the values stored in the cache. Depending on the Concrete cache duplicates might be possible.

Specified by:
values in interface ICacheManager<K,V>
Returns:
All the values in the cache as a collection.

store

public void store()
Stores a cache to some type of durable storage. Not gaurenteed to be implemented, dependant on the concrete implementation. This method should perform a NoOp if it is not supported.

Specified by:
store in interface ICacheManager<K,V>

load

public void load()
Loads a cache from some type of durable storage. Not gaurenteed to be implemented, dependant on the concrete implementation. This method should perform a NoOp if it is not supported.

Specified by:
load in interface ICacheManager<K,V>


Copyright © 2010 YES Technology Association. All Rights Reserved.