Interface ScheduledCommandCache.StagedScheduledCommandCache

All Superinterfaces:
ScheduledCommandCache, ScheduledCommandCache.ScheduledCommandCacheChanges
All Known Implementing Classes:
ScheduledCommandCache.NoopScheduledCommandCache
Enclosing interface:
ScheduledCommandCache

public static interface ScheduledCommandCache.StagedScheduledCommandCache extends ScheduledCommandCache, ScheduledCommandCache.ScheduledCommandCacheChanges
A cache where modifications are staged but not added to the main cache which produced it. Call ScheduledCommandCache.ScheduledCommandCacheChanges.persist() to do so.

The semantics of each operation are changed slightly:

A staged ScheduledCommandCache.add(Intent, long) will buffer the intent/key pair, and all buffered pairs are added to the main cache on ScheduledCommandCache.ScheduledCommandCacheChanges.persist().

A staged ScheduledCommandCache.remove(Intent, long) only removes buffered intent/key pairs.

A staged ScheduledCommandCache.contains(Intent, long) first looks up the buffered intent/key pairs, and if not found, will also perform a look-up in the main cache.

A staged ScheduledCommandCache.clear() only removes the staged keys, and does not touch the main cache.