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

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

public class MemcacheDtoCacheImpl<K,V>
extends java.lang.Object
implements DtoCache<K,V>

Memcache DtoCache uses MemcacheService - distributed cache. The max size is not relevant for this type of cache.


Field Summary
static java.lang.String ANONYMOUS
          The anonymous suffix name used for MemcacheService's namespace..
static java.lang.String DEFAULT_NAMESPACE_PREFIX
          The default MemcacheService namespace prefix.
protected  MemcacheService memcacheService
          The underlying memcache instance.
 
Constructor Summary
MemcacheDtoCacheImpl()
          Creates anonymous memcache instance.
MemcacheDtoCacheImpl(java.lang.String name)
          Creates named memcache instance.
MemcacheDtoCacheImpl(java.lang.String namespacePrefix, java.lang.String namespaceSuffix)
          Creates named memcache instance.
 
Method Summary
 void clear()
          Clears the cache.
 V get(K key)
          Returns the associated object or null.
 void put(K key, V value)
          Puts the key/value pair into the cache.
 void remove(K key)
          Removes the associated object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAMESPACE_PREFIX

public static final java.lang.String DEFAULT_NAMESPACE_PREFIX
The default MemcacheService namespace prefix.

See Also:
Constant Field Values

ANONYMOUS

public static final java.lang.String ANONYMOUS
The anonymous suffix name used for MemcacheService's namespace..

See Also:
Constant Field Values

memcacheService

protected final MemcacheService memcacheService
The underlying memcache instance.

Constructor Detail

MemcacheDtoCacheImpl

public MemcacheDtoCacheImpl()
Creates anonymous memcache instance.


MemcacheDtoCacheImpl

public MemcacheDtoCacheImpl(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.


MemcacheDtoCacheImpl

public MemcacheDtoCacheImpl(java.lang.String namespacePrefix,
                            java.lang.String namespaceSuffix)
Creates named memcache instance.

Method Detail

get

public V get(K key)
Returns the associated object or null.

Specified by:
get in interface DtoCache<K,V>

put

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

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

remove

public void remove(K key)
Removes the associated object.

Specified by:
remove in interface DtoCache<K,V>

clear

public void clear()
Clears the cache. NOTE: this clears ALL items no regards the namespaces.

Specified by:
clear in interface DtoCache<K,V>


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