public class MemcachedWrapper extends AbstractListeningCacheWrapper implements BlockingCache
Modifier and Type | Class and Description |
---|---|
protected static class |
MemcachedWrapper.CacheEntriesWithKeys
Cache entry holding key-value pair.
|
protected class |
MemcachedWrapper.EmptyUncacheableEntry
Entry which we return if there are are more keys with the same hash.
|
Constructor and Description |
---|
MemcachedWrapper(CacheModule cacheModule,
CacheMonitor cacheMonitor,
net.spy.memcached.MemcachedClientIF client,
Integer blockingTimeout,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected String |
createHash(Object originalKey) |
Object |
get(Object key) |
int |
getBlockingTimeout()
If the timeout is reached an exception is thrown to unlock the blocked thread (in
milliseconds).
|
Collection<Object> |
getKeys() |
String |
getName() |
Object |
getQuiet(Object key) |
int |
getSize() |
Map<SocketAddress,Map<String,String>> |
getStats() |
boolean |
hasElement(Object key) |
void |
put(Object key,
Object value) |
void |
put(Object key,
Object value,
int timeToLiveInSeconds) |
void |
remove(Object key) |
protected void |
shutdown() |
void |
unlock(Object key)
Will unlock the key.
|
@Inject public MemcachedWrapper(CacheModule cacheModule, CacheMonitor cacheMonitor, net.spy.memcached.MemcachedClientIF client, Integer blockingTimeout, String name)
public Object get(Object key)
get
in interface Cache
get
in class AbstractListeningCacheWrapper
public Object getQuiet(Object key)
getQuiet
in interface Cache
getQuiet
in class AbstractListeningCacheWrapper
public boolean hasElement(Object key)
hasElement
in interface Cache
public void put(Object key, Object value)
put
in interface Cache
put
in class AbstractListeningCacheWrapper
public void put(Object key, Object value, int timeToLiveInSeconds)
put
in interface Cache
put
in class AbstractListeningCacheWrapper
public void remove(Object key)
remove
in interface Cache
remove
in class AbstractListeningCacheWrapper
public void clear()
clear
in interface Cache
clear
in class AbstractListeningCacheWrapper
public void unlock(Object key)
BlockingCache
unlock
in interface BlockingCache
public int getBlockingTimeout()
BlockingCache
getBlockingTimeout
in interface BlockingCache
public String getName()
getName
in interface Cache
getName
in class AbstractListeningCacheWrapper
public int getSize()
getSize
in interface Cache
getSize
in class AbstractListeningCacheWrapper
public Collection<Object> getKeys()
public Map<SocketAddress,Map<String,String>> getStats()
protected void shutdown()
Copyright © 2015 Magnolia International Ltd.. All rights reserved.