Skip to content

Commit

Permalink
Added notification for REMOVED case in ehcache event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Alfonsi committed Dec 1, 2023
1 parent 01bcad7 commit c6a93a4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ public void onEvent(CacheEvent<? extends K, ? extends byte[]> event) {
assert event.getNewValue() == null;
break;
case REMOVED:
this.removalListener.ifPresent(
listener -> listener.onRemoval(
new RemovalNotification<>(
event.getKey(),
valueSerializer.deserialize(event.getOldValue()),
RemovalReason.INVALIDATED,
TierType.DISK
)
)
);
count.dec();
assert event.getNewValue() == null;
break;
Expand Down

0 comments on commit c6a93a4

Please sign in to comment.