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-aware CachedReference backed by a gRPC transport. There is no support for modifying the cached reference settings after the cache has been created.
Since:
9.5
  • Constructor Details

    • 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 Details

    • isReplicateViaCopy

      public boolean isReplicateViaCopy()
      Specified by:
      isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
      Overrides:
      isReplicateViaCopy in class ManagedCacheSupport
    • get

      @NotNull public V get()
      Specified by:
      get in interface com.atlassian.cache.CachedReference<V>
    • reset

      public void reset()
      Specified by:
      reset in interface com.atlassian.cache.CachedReference<V>
    • processRemoteReset

      public void processRemoteReset()
      Specified by:
      processRemoteReset in interface CachedReferenceRemoteAccessor
    • isPresent

      public boolean isPresent()
      Specified by:
      isPresent in interface com.atlassian.cache.CachedReference<V>
    • getIfPresent

      @NotNull public @NotNull Optional<V> getIfPresent()
      Specified by:
      getIfPresent in interface com.atlassian.cache.CachedReference<V>
    • addListener

      public void addListener(@NotNull @NotNull com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues)
      Specified by:
      addListener in interface com.atlassian.cache.CachedReference<V>
    • removeListener

      public void removeListener(@NotNull @NotNull com.atlassian.cache.CachedReferenceListener<V> listener)
      Specified by:
      removeListener in interface com.atlassian.cache.CachedReference<V>
    • clear

      public void clear()
      Specified by:
      clear in interface com.atlassian.cache.ManagedCache