Package com.atlassian.bamboo.util
Class CacheAwareness
java.lang.Object
com.atlassian.bamboo.util.CacheAwareness
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CacheAwareness.CacheInfo
static final CacheAwareness.CacheInfo
static final CacheAwareness.CacheInfo
-
Method Summary
Modifier and TypeMethodDescriptionstatic CacheAwareness.CacheInfo
static Pair<Iterable<CacheAwareness.CacheInfo>,
Long> withValuesOlderThanTimestampReloaded
(BambooCallables.ThrowingX<V, E1, E2, E3> callable, long timestamp, @Nullable CacheAwareness.CacheInfo... disabledCaches) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestampwithValuesOlderThanTimestampReloaded
(BambooRunnables.ThrowingX<E1, E2, E3> runnable, long timestamp, @Nullable CacheAwareness.CacheInfo... disabledCached) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestampwithValuesOlderThanTimestampReloaded
(BambooRunnables.ThrowingX<E1, E2, E3> runnable, long timestamp, Iterable<CacheAwareness.CacheInfo> disabledCaches) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestamp
-
Field Details
-
CHANGE_DETECTION
-
BRANCH_DETECTION
-
ANY
-
-
Method Details
-
cacheInfo
-
withValuesOlderThanTimestampReloaded
public static <E1 extends Exception,E2 extends Exception, void withValuesOlderThanTimestampReloadedE3 extends Exception> (BambooRunnables.ThrowingX<E1, E2, throws E2, E1, E3E3> runnable, long timestamp, @Nullable @Nullable CacheAwareness.CacheInfo... disabledCached) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestamp- Parameters:
timestamp
- denotes the time of the request, typically System.currentTimeMilis().
If the value in cache was loaded AFTER this timestamp, the cache will NOT be reloaded.
If the value in cache was created BEFORE the timestamp, for disabled CacheInfos we reload the value.
If you want the cached values to be always reloaded and know what you are doing, use Long.MAX_VALUE for timestamp.disabledCaches
- caches to be affected within the runnable- Throws:
E2 extends Exception
E1 extends Exception
E3 extends Exception
-
withValuesOlderThanTimestampReloaded
public static <V,E1 extends Exception, V withValuesOlderThanTimestampReloadedE2 extends Exception, E3 extends Exception> (BambooCallables.ThrowingX<V, E1, throws E2, E1, E3E2, E3> callable, long timestamp, @Nullable @Nullable CacheAwareness.CacheInfo... disabledCaches) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestamp- Parameters:
timestamp
- denotes the time of the request, typically System.currentTimeMilis().
If the value in cache was loaded AFTER this timestamp, the cache will NOT be reloaded.
If the value in cache was created BEFORE the timestamp, for disabled CacheInfos we reload the value.
If you want the cached values to be always reloaded and know what you are doing, use Long.MAX_VALUE for timestamp.disabledCaches
- caches to be affected within the runnable- Throws:
E2 extends Exception
E1 extends Exception
E3 extends Exception
-
withValuesOlderThanTimestampReloaded
public static <E1 extends Exception,E2 extends Exception, void withValuesOlderThanTimestampReloadedE3 extends Exception> (BambooRunnables.ThrowingX<E1, E2, throws E2, E1, E3E3> runnable, long timestamp, Iterable<CacheAwareness.CacheInfo> disabledCaches) Executes the supplied runnable with the listed caches invalidated, values reloaded if value was previously cached before the timestamp- Parameters:
timestamp
- denotes the time of the request, typically System.currentTimeMilis().
If the value in cache was loaded AFTER this timestamp, the cache will NOT be reloaded.
If the value in cache was created BEFORE the timestamp, for disabled CacheInfos we reload the value.
If you want the cached values to be always reloaded and know what you are doing, use Long.MAX_VALUE for timestamp.disabledCaches
- caches to be affected within the runnable- Throws:
E2 extends Exception
E1 extends Exception
E3 extends Exception
-
getDisabledCachesTimestamp
-