com.atlassian.cache.hazelcast
Class HazelcastCachedReference<V>

java.lang.Object
  extended by com.atlassian.cache.hazelcast.ManagedCacheSupport
      extended by com.atlassian.cache.hazelcast.HazelcastCachedReference<V>
All Implemented Interfaces:
CachedReference<V>, ManagedCache

public class HazelcastCachedReference<V>
extends ManagedCacheSupport
implements CachedReference<V>

A CachedReference implementation to satisfy the requirements of CacheFactory.

Since:
2.4.0

Method Summary
 void addListener(CachedReferenceListener<V> listener, boolean includeValues)
          Adds a CachedReferenceListener
 void clear()
          Clear the cache.
 boolean equals(Object o)
           
 V get()
          Get a value from the cache.
 int hashCode()
           
 void removeListener(CachedReferenceListener<V> listener)
          Removes a CachedReferenceListener
 void reset()
          Resets (clears/invalidates) this reference.
 
Methods inherited from class com.atlassian.cache.hazelcast.ManagedCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getName, getStatistics, isFlushable, isLocal, isReplicateAsynchronously, isReplicateViaCopy, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clear

public void clear()
Description copied from interface: ManagedCache
Clear the cache.

Specified by:
clear in interface ManagedCache

get

@Nonnull
public V get()
Description copied from interface: CachedReference
Get a value from the cache.

Specified by:
get in interface CachedReference<V>
Returns:
the cached value

reset

public void reset()
Description copied from interface: CachedReference
Resets (clears/invalidates) this reference.

Specified by:
reset in interface CachedReference<V>

equals

public boolean equals(@Nullable
                      Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

addListener

public void addListener(@Nonnull
                        CachedReferenceListener<V> listener,
                        boolean includeValues)
Description copied from interface: CachedReference
Adds a CachedReferenceListener

Specified by:
addListener in interface CachedReference<V>
Parameters:
listener - the listener
includeValues - if the events sent to this listener will include old/new value. This can be used in cases when the cost of finding these values is big (network sync) but the listener is not interested in the concrete values for events its getting. The support for this parameter is optional and implementation dependent

removeListener

public void removeListener(@Nonnull
                           CachedReferenceListener<V> listener)
Description copied from interface: CachedReference
Removes a CachedReferenceListener

Specified by:
removeListener in interface CachedReference<V>
Parameters:
listener - the listener


Copyright © 2015 Atlassian. All rights reserved.