Package org.cache2k.expiry
Interface ExpiryTimeValues
-
- All Known Subinterfaces:
ExpiryPolicy<K,V>,ResiliencePolicy<K,V>
- All Known Implementing Classes:
Expiry
public interface ExpiryTimeValuesExpiry time values that have a special meaning. Used for expressive return values in the customizationsResiliencePolicyandExpiryPolicyas well asCache.expireAt(Object, long).Users may want to use the class
Expirywith additional utility methods as alternative.- Author:
- Jens Wilke
- See Also:
ExpiryPolicy,ResiliencePolicy,Cache.expireAt(K, long),MutableCacheEntry.setExpiryTime(long),Expiry
-
-
Field Summary
Fields Modifier and Type Field Description static longETERNALReturn value signalling to keep the value forever in the cache, switching off expiry.static longNEUTRALDon't change the expiry of the entry.static longNOWThe value expires immediately and will not be cached.static longREFRESHExpires the entry and starts a refresh ifCache2kBuilder.refreshAhead(boolean)is enabled.
-
-
-
Field Detail
-
NEUTRAL
static final long NEUTRAL
Don't change the expiry of the entry. This can be used for an update. This is also used for an undefined / not applicable expiry time value inMutableCacheEntry.getExpiryTime(). The value is identical toCache2kConfig.UNSET_LONG- See Also:
- Constant Field Values
-
NOW
static final long NOW
The value expires immediately and will not be cached. No refreshing is started.- See Also:
- Constant Field Values
-
REFRESH
static final long REFRESH
Expires the entry and starts a refresh ifCache2kBuilder.refreshAhead(boolean)is enabled. With a positive value the current value is visible until the refresh is complete. With a negative value aget()requests will block until the refreshed value is available.Rationale: Any value in the past does and between the current time, does the same as if the time is reached just now.
- See Also:
- Constant Field Values
-
ETERNAL
static final long ETERNAL
Return value signalling to keep the value forever in the cache, switching off expiry. If the cache has a static expiry time configured, then this is used instead.- See Also:
- Constant Field Values
-
-