com.atlassian.confluence.cache.tangosol
Class TangosolCache<K,V>

java.lang.Object
  extended by com.atlassian.confluence.cache.tangosol.TangosolCache<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>, ConfigurableCache<K,V>

public class TangosolCache<K,V>
extends java.lang.Object
implements ConfigurableCache<K,V>

A decorator class to call the correct methods in Tangosol's cache object.


Constructor Summary
TangosolCache(com.tangosol.net.NamedCache cache)
           
TangosolCache(com.tangosol.net.NamedCache cache, com.atlassian.cache.CacheLoader<K,V> loader)
           
 
Method Summary
 boolean containsKey(K k)
           
 boolean equals(java.lang.Object o)
           
 V get(K key)
           
 java.util.Collection<K> getKeys()
           
 java.lang.String getName()
           
 int getStatus()
          Deprecated.  
 int hashCode()
           
 void put(K key, V value)
           
 V putIfAbsent(K key, V value)
           
 void remove(K key)
           
 boolean remove(K key, V value)
           
 void removeAll()
           
 boolean replace(K key, V oldValue, V newValue)
           
 void setTimeToLive(long timeToLive, java.util.concurrent.TimeUnit timeUnit)
          Update the time to live.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TangosolCache

public TangosolCache(com.tangosol.net.NamedCache cache)

TangosolCache

public TangosolCache(com.tangosol.net.NamedCache cache,
                     com.atlassian.cache.CacheLoader<K,V> loader)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface com.atlassian.cache.Cache<K,V>

get

public V get(K key)
Specified by:
get in interface com.atlassian.cache.Cache<K,V>

containsKey

public boolean containsKey(@NotNull
                           K k)
Specified by:
containsKey in interface com.atlassian.cache.Cache<K,V>

getKeys

public java.util.Collection<K> getKeys()
Specified by:
getKeys in interface com.atlassian.cache.Cache<K,V>

put

public void put(K key,
                V value)
Specified by:
put in interface com.atlassian.cache.Cache<K,V>

remove

public void remove(K key)
Specified by:
remove in interface com.atlassian.cache.Cache<K,V>

removeAll

public void removeAll()
Specified by:
removeAll in interface com.atlassian.cache.Cache<K,V>

getStatus

@Deprecated
public int getStatus()
Deprecated. 

(Suppress compiler error)


setTimeToLive

public void setTimeToLive(long timeToLive,
                          java.util.concurrent.TimeUnit timeUnit)
Description copied from interface: ConfigurableCache
Update the time to live. Please note, some implementations cannot store time values smaller than TimeUnit.SECONDS.

Specified by:
setTimeToLive in interface ConfigurableCache<K,V>
Parameters:
timeToLive - value
timeUnit - unit of time

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

putIfAbsent

public V putIfAbsent(K key,
                     V value)
Specified by:
putIfAbsent in interface com.atlassian.cache.Cache<K,V>

replace

public boolean replace(K key,
                       V oldValue,
                       V newValue)
Specified by:
replace in interface com.atlassian.cache.Cache<K,V>

remove

public boolean remove(K key,
                      V value)
Specified by:
remove in interface com.atlassian.cache.Cache<K,V>


Copyright © 2003-2014 Atlassian. All Rights Reserved.