@Test public void testAbort() { BaseCache<Integer, Integer> bc = (BaseCache<Integer, Integer>) builder().build(); Semantic op = new Semantic<Integer, Integer, Object>() { AtomicInteger count = new AtomicInteger(); @Override public void start(final Progress<Integer, Integer, Object> c) { c.wantData(); } @Override public void examine(final Progress<Integer, Integer, Object> c, final ExaminationEntry<Integer, Integer> e) { if (count.getAndIncrement() % 2 == 0) { c.wantMutation(); } else { c.noMutation(); } } @Override public void mutate(final Progress<Integer, Integer, Object> c, final ExaminationEntry<Integer, Integer> e) { c.put(123); } @Override public void loaded(final Progress<Integer, Integer, Object> c, final ExaminationEntry<Integer, Integer> e) { } }; bc.execute(1, op); assertFalse(bc.containsKey(1)); assertTrue(bc.getStatistics().getSize() == 0); bc.put(1, 987); bc.execute(1, op); assertEquals("unchanged", 987, (int) bc.peek(1)); }
public void abort() { if (entryLocked) { abortReleaseLock(); return; } abortFinalize(); }
EntryAction extends Entry.PiggyBack implements
  Runnable,
  AsyncCacheLoader.Context<K, V>,
  AsyncCacheLoader.Callback<V>, AsyncCacheWriter.Callback, Progress<K, V, R> { public void abort() { if (entryLocked) { abortReleaseLock(); return; } abortFinalize(); } }
EntryAction extends Entry.PiggyBack implements
  Runnable,
  AsyncCacheLoader.Context<K, V>,
  AsyncCacheLoader.Callback<V>, AsyncCacheWriter.Callback, Progress<K, V, R> { public void abort() { if (entryLocked) { abortReleaseLock(); return; } abortFinalize(); } @SuppressWarnings("unchecked")  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e, CompletedCallback<K, V, R> cb);  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e); }
EntryAction extends Entry.PiggyBack implements
  Runnable,
  AsyncCacheLoader.Context<K, V>,
  AsyncCacheLoader.Callback<V>, AsyncCacheWriter.Callback, Progress<K, V, R> { public void abort() { if (entryLocked) { abortReleaseLock(); return; } abortFinalize(); } @SuppressWarnings("unchecked")  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e, CompletedCallback<K, V, R> cb);  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e); @SuppressWarnings("rawtypes") void enqueueToExecute(EntryAction v); @Override Executor getExecutor(); @Override K getKey(); @Override long getLoadStartTime(); @Override long getMutationStartTime(); @Override CacheEntry<K, V> getCurrentEntry(); @Override boolean isLoaderPresent(); @Override boolean wasLoaded(); @Override boolean isDataFresh(); @Override boolean isExpiryTimeReachedOrInRefreshProbation(); @Override boolean isDataFreshOrRefreshing(); @Override boolean isDataFreshOrMiss(); @Override void run(); void start(); @Override void wantData(); void retrieveDataFromHeap(); void heapMiss(); void heapHit(Entry<K, V> e); void skipHeapAccessEntryPresent(); void examine(); @Override void noMutation(); @Override void wantMutation(); void examineAgainAfterLock(); void checkExpiryBeforeMutation(); void existingEntryExpiredBeforeMutationSendExpiryEvents(); void noExpiryListenersPresent(); void continueWithMutation(); @Override void loadAndRestart(); @Override void refresh(); @Override void load(); void reviveRefreshedEntry(long nrt); @Override void onLoadSuccess(V v); @Override void onLoadFailure(Throwable t); void loadCompleted(); @Override void result(R r); @SuppressWarnings("unchecked") @Override void entryResult(ExaminationEntry<K, V> e); @Override void put(V value); @Override void remove(); @Override void expire(long expiryTime); @Override void putAndSetExpiry(V value, long expiryTime, long refreshTime); void mutationCalculateExpiry(); void expiryCalculationException(Throwable t); void expiryCalculated(); void loadAndExpiryCalculatedExamineAgain(); void updateDidNotTriggerDifferentMutationStoreLoadedValue(); void mutationMayCallWriter(); void mutationCallWriter(); @Override void onWriteSuccess(); @Override void onWriteFailure(Throwable t); void skipWritingForException(); void skipWritingNoWriter(); void checkKeepOrRemove(); void expiredImmediatelyKeepData(); void expiredImmediatelyAndRemove(); void mutationUpdateHeap(); void mutationMayStore(); void skipStore(); void callListeners(); void mutationReleaseLockAndStartTimer(); void expiredAtEndOfOperationStartOver(); void updateMutationStatistics(); @Override void failure(RuntimeException t); void examinationAbort(CustomizationException t); void mutationAbort(RuntimeException t); void mutationDone(); void abort(); void abortReleaseLock(); void abortFinalize(); void completeProcessCallbacks(); void ready(); }
EntryAction extends Entry.PiggyBack implements
  Runnable,
  AsyncCacheLoader.Context<K, V>,
  AsyncCacheLoader.Callback<V>, AsyncCacheWriter.Callback, Progress<K, V, R> { public void abort() { if (entryLocked) { abortReleaseLock(); return; } abortFinalize(); } @SuppressWarnings("unchecked")  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e, CompletedCallback<K, V, R> cb);  EntryAction(HeapCache<K, V> heapCache, InternalCache<K, V> userCache,
                     Semantic<K, V, R> op, K k, Entry<K, V> e); @SuppressWarnings("rawtypes") void enqueueToExecute(EntryAction v); @Override Executor getExecutor(); @Override K getKey(); @Override long getLoadStartTime(); @Override long getMutationStartTime(); @Override CacheEntry<K, V> getCurrentEntry(); @Override boolean isLoaderPresent(); @Override boolean wasLoaded(); @Override boolean isDataFresh(); @Override boolean isExpiryTimeReachedOrInRefreshProbation(); @Override boolean isDataFreshOrRefreshing(); @Override boolean isDataFreshOrMiss(); @Override void run(); void start(); @Override void wantData(); void retrieveDataFromHeap(); void heapMiss(); void heapHit(Entry<K, V> e); void skipHeapAccessEntryPresent(); void examine(); @Override void noMutation(); @Override void wantMutation(); void examineAgainAfterLock(); void checkExpiryBeforeMutation(); void existingEntryExpiredBeforeMutationSendExpiryEvents(); void noExpiryListenersPresent(); void continueWithMutation(); @Override void loadAndRestart(); @Override void refresh(); @Override void load(); void reviveRefreshedEntry(long nrt); @Override void onLoadSuccess(V v); @Override void onLoadFailure(Throwable t); void loadCompleted(); @Override void result(R r); @SuppressWarnings("unchecked") @Override void entryResult(ExaminationEntry<K, V> e); @Override void put(V value); @Override void remove(); @Override void expire(long expiryTime); @Override void putAndSetExpiry(V value, long expiryTime, long refreshTime); void mutationCalculateExpiry(); void expiryCalculationException(Throwable t); void expiryCalculated(); void loadAndExpiryCalculatedExamineAgain(); void updateDidNotTriggerDifferentMutationStoreLoadedValue(); void mutationMayCallWriter(); void mutationCallWriter(); @Override void onWriteSuccess(); @Override void onWriteFailure(Throwable t); void skipWritingForException(); void skipWritingNoWriter(); void checkKeepOrRemove(); void expiredImmediatelyKeepData(); void expiredImmediatelyAndRemove(); void mutationUpdateHeap(); void mutationMayStore(); void skipStore(); void callListeners(); void mutationReleaseLockAndStartTimer(); void expiredAtEndOfOperationStartOver(); void updateMutationStatistics(); @Override void failure(RuntimeException t); void examinationAbort(CustomizationException t); void mutationAbort(RuntimeException t); void mutationDone(); void abort(); void abortReleaseLock(); void abortFinalize(); void completeProcessCallbacks(); void ready(); @SuppressWarnings("rawtypes")
  static final Entry NON_FRESH_DUMMY; }