com.atlassian.cache
Interface CachedReference<V>

All Known Implementing Classes:
HazelcastCachedReference, HazelcastHybridCachedReference

@PublicApi
public interface CachedReference<V>

A Resettable reference.

Since:
2.0

Method Summary
 void addListener(CachedReferenceListener<V> listener, boolean includeValues)
          Adds a CachedReferenceListener
 V get()
          Get a value from the cache.
 void removeListener(CachedReferenceListener<V> listener)
          Removes a CachedReferenceListener
 void reset()
          Resets (clears/invalidates) this reference.
 

Method Detail

get

@Nonnull
V get()
Get a value from the cache.

Returns:
the cached value

reset

void reset()
Resets (clears/invalidates) this reference.


addListener

void addListener(@Nonnull
                 CachedReferenceListener<V> listener,
                 boolean includeValues)
Adds a CachedReferenceListener

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
Since:
2.4

removeListener

void removeListener(@Nonnull
                    CachedReferenceListener<V> listener)
Removes a CachedReferenceListener

Parameters:
listener - the listener
Since:
2.4


Copyright © 2015 Atlassian. All rights reserved.