• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009

Description

It will be nice to have a function to notify an Element when it is removed from Cache to be able to store its content in, for example, a DataBase.

When an Element is removed from Cache, a function like Element.willBeRemoved() should be called to notify the Element of its removal from Cache. We can overload the willBeRemoved function to perform custom actions upon removal.

Changes: 1) MemoryStore: function removeLeastRecentlyUsedElement(): When an Element is removed AND not spooled to disk, element.willBeRemoved should be called. if (cache.isOverflowToDisk()) { spoolToDisk(element); } // new part else { element.willBeRemove(); } </code snip>

2) Element: add function willBeRemoved() // default: do nothing, overload to perform action(s) public void willBeRemove() {} </code snip>

Sourceforge Ticket ID: 1198895 - Opened By: ricktw - 10 May 2005 09:26 UTC

Comments

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira