com.atlassian.confluence.cache.hazelcast
Class AbstractHazelcastCache<K,V>

java.lang.Object
  extended by com.atlassian.confluence.cache.hazelcast.AbstractHazelcastCache<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>, com.atlassian.cache.ManagedCache, ConfigurableCache<K,V>, ConfigurableManagedLockingCache<K,V>, ManagedLockingCache<K,V>
Direct Known Subclasses:
ConfluenceHazelcastCache, ConfluenceHybridCache

public abstract class AbstractHazelcastCache<K,V>
extends java.lang.Object
implements ConfigurableManagedLockingCache<K,V>

Common behaviour for Hazelcast based caches.


Constructor Summary
AbstractHazelcastCache(java.lang.String cacheName, com.hazelcast.map.MapContainer container, boolean flushable)
           
 
Method Summary
 java.lang.Long currentExpireAfterAccessMillis()
           
 java.lang.Long currentExpireAfterWriteMillis()
           
 java.lang.Integer currentMaxEntries()
           
 java.lang.String getName()
           
 boolean isFlushable()
           
 boolean isLocal()
           
 boolean isReplicateAsynchronously()
           
 void setTimeToLive(long timeToLive, java.util.concurrent.TimeUnit timeUnit)
          Update the time to live.
 boolean updateExpireAfterAccess(long expireAfter, java.util.concurrent.TimeUnit timeUnit)
           
 boolean updateExpireAfterWrite(long expireAfter, java.util.concurrent.TimeUnit timeUnit)
           
 boolean updateMaxEntries(int newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.cache.ManagedLockingCache
lock, unlock
 
Methods inherited from interface com.atlassian.cache.ManagedCache
clear, isReplicateViaCopy
 
Methods inherited from interface com.atlassian.cache.Cache
containsKey, get, getKeys, put, putIfAbsent, remove, remove, removeAll, replace
 

Constructor Detail

AbstractHazelcastCache

public AbstractHazelcastCache(java.lang.String cacheName,
                              com.hazelcast.map.MapContainer container,
                              boolean flushable)
Method Detail

getName

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

isFlushable

public boolean isFlushable()
Specified by:
isFlushable in interface com.atlassian.cache.ManagedCache

currentMaxEntries

public java.lang.Integer currentMaxEntries()
Specified by:
currentMaxEntries in interface com.atlassian.cache.ManagedCache

updateMaxEntries

public boolean updateMaxEntries(int newValue)
Specified by:
updateMaxEntries in interface com.atlassian.cache.ManagedCache

currentExpireAfterAccessMillis

public java.lang.Long currentExpireAfterAccessMillis()
Specified by:
currentExpireAfterAccessMillis in interface com.atlassian.cache.ManagedCache

updateExpireAfterAccess

public boolean updateExpireAfterAccess(long expireAfter,
                                       java.util.concurrent.TimeUnit timeUnit)
Specified by:
updateExpireAfterAccess in interface com.atlassian.cache.ManagedCache

currentExpireAfterWriteMillis

public java.lang.Long currentExpireAfterWriteMillis()
Specified by:
currentExpireAfterWriteMillis in interface com.atlassian.cache.ManagedCache

updateExpireAfterWrite

public boolean updateExpireAfterWrite(long expireAfter,
                                      java.util.concurrent.TimeUnit timeUnit)
Specified by:
updateExpireAfterWrite in interface com.atlassian.cache.ManagedCache

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

isLocal

public boolean isLocal()
Specified by:
isLocal in interface com.atlassian.cache.ManagedCache

isReplicateAsynchronously

public boolean isReplicateAsynchronously()
Specified by:
isReplicateAsynchronously in interface com.atlassian.cache.ManagedCache


Copyright © 2003-2014 Atlassian. All Rights Reserved.