com.spoledge.audao.db.dao.gae
Class ExpiringMemcacheDtoCacheImpl<K,V>

java.lang.Object
  extended by com.spoledge.audao.db.dao.gae.MemcacheDtoCacheImpl<K,V>
      extended by com.spoledge.audao.db.dao.gae.ExpiringMemcacheDtoCacheImpl<K,V>
All Implemented Interfaces:
DtoCache<K,V>

public class ExpiringMemcacheDtoCacheImpl<K,V>
extends MemcacheDtoCacheImpl<K,V>

Expiring variant of the Memcache DtoCache. Since teh MemcacheService distinguishes between seconds or milliseconds expiration periods, we truncate any period longer than 60000 millis (= 1 minute) to seconds.


Field Summary
protected  int expireMillis
           
protected  int expireSecs
           
protected  boolean isSecs
           
 
Fields inherited from class com.spoledge.audao.db.dao.gae.MemcacheDtoCacheImpl
ANONYMOUS, DEFAULT_NAMESPACE_PREFIX, memcacheService
 
Constructor Summary
ExpiringMemcacheDtoCacheImpl(long expireMillis)
          Creates anonymous memcache instance.
ExpiringMemcacheDtoCacheImpl(long expireMillis, java.lang.String name)
          Creates named memcache instance.
ExpiringMemcacheDtoCacheImpl(long expireMillis, java.lang.String namespacePrefix, java.lang.String namespaceSuffix)
          Creates named memcache instance.
 
Method Summary
 void put(K key, V value)
          Puts the key/value pair into the cache.
 
Methods inherited from class com.spoledge.audao.db.dao.gae.MemcacheDtoCacheImpl
clear, get, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expireMillis

protected int expireMillis

expireSecs

protected int expireSecs

isSecs

protected boolean isSecs
Constructor Detail

ExpiringMemcacheDtoCacheImpl

public ExpiringMemcacheDtoCacheImpl(long expireMillis)
Creates anonymous memcache instance.


ExpiringMemcacheDtoCacheImpl

public ExpiringMemcacheDtoCacheImpl(long expireMillis,
                                    java.lang.String name)
Creates named memcache instance. The full namespace is set as: DEFAULT_NAMESPACE_PREFIX + name . This is used for generated DAO implementation classes.


ExpiringMemcacheDtoCacheImpl

public ExpiringMemcacheDtoCacheImpl(long expireMillis,
                                    java.lang.String namespacePrefix,
                                    java.lang.String namespaceSuffix)
Creates named memcache instance.

Method Detail

put

public void put(K key,
                V value)
Puts the key/value pair into the cache.

Specified by:
put in interface DtoCache<K,V>
Overrides:
put in class MemcacheDtoCacheImpl<K,V>


Copyright © 2010 Spolecne s.r.o. All Rights Reserved.