Class GrpcBackedCachedReference<V>
- java.lang.Object
-
- com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
-
- com.atlassian.bamboo.cluster.atlassiancache.GrpcBackedCachedReference<V>
-
- Type Parameters:
V
- value type
- All Implemented Interfaces:
CachedReferenceRemoteAccessor
,com.atlassian.cache.CachedReference<V>
,com.atlassian.cache.ManagedCache
public class GrpcBackedCachedReference<V> extends ManagedCacheSupport implements com.atlassian.cache.CachedReference<V>, CachedReferenceRemoteAccessor
A cluster-awareCachedReference
backed by a gRPC transport. There is no support for modifying the cached reference settings after the cache has been created.- Since:
- 9.5
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
cacheManager, name
-
-
Constructor Summary
Constructors Constructor Description GrpcBackedCachedReference(@NotNull String name, @NotNull com.atlassian.cache.Supplier<V> supplier, @NotNull GrpcBackedCacheManager cacheManager, @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull com.atlassian.cache.CacheFactory localFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(@NotNull com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues)
void
clear()
V
get()
@NotNull Optional<V>
getIfPresent()
boolean
isPresent()
boolean
isReplicateViaCopy()
void
processRemoteReset()
void
removeListener(@NotNull com.atlassian.cache.CachedReferenceListener<V> listener)
void
reset()
-
Methods inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getCacheSettings, getName, getStatistics, isFlushable, isLocal, isReplicateAsynchronously, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
-
-
-
-
Constructor Detail
-
GrpcBackedCachedReference
public GrpcBackedCachedReference(@NotNull @NotNull String name, @NotNull @NotNull com.atlassian.cache.Supplier<V> supplier, @NotNull @NotNull GrpcBackedCacheManager cacheManager, @Nullable @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull @NotNull com.atlassian.cache.CacheFactory localFactory)
-
-
Method Detail
-
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
isReplicateViaCopy
in interfacecom.atlassian.cache.ManagedCache
- Overrides:
isReplicateViaCopy
in classManagedCacheSupport
-
reset
public void reset()
- Specified by:
reset
in interfacecom.atlassian.cache.CachedReference<V>
-
processRemoteReset
public void processRemoteReset()
- Specified by:
processRemoteReset
in interfaceCachedReferenceRemoteAccessor
-
isPresent
public boolean isPresent()
- Specified by:
isPresent
in interfacecom.atlassian.cache.CachedReference<V>
-
getIfPresent
@NotNull public @NotNull Optional<V> getIfPresent()
- Specified by:
getIfPresent
in interfacecom.atlassian.cache.CachedReference<V>
-
addListener
public void addListener(@NotNull @NotNull com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues)
- Specified by:
addListener
in interfacecom.atlassian.cache.CachedReference<V>
-
removeListener
public void removeListener(@NotNull @NotNull com.atlassian.cache.CachedReferenceListener<V> listener)
- Specified by:
removeListener
in interfacecom.atlassian.cache.CachedReference<V>
-
clear
public void clear()
- Specified by:
clear
in interfacecom.atlassian.cache.ManagedCache
-
-