2 Replies Latest reply on Mar 30, 2007 4:39 PM by Elias Ross

    Removal policies

    Elias Ross Master


      Talking with some fellow devs, I'd like to have the eviction policies really handle removes not just evicts.

      One use case is:
      1. I am only allowed to fetch a user's profile once every 4 hours.
      2. I must remove this profile after 4 hours.
      3. This data needs to be persisted.

      I know it is somewhat stretching the meaning of eviction, but there are no "removal policies" available.

      Is this something that's been given consideration?

        • 1. Re: Removal policies
          Manik Surtani Master

          It should be easy enough to implement (a flag in the eviction region that causes a removal rather than an eviction when triggered) but I'm concerned that this would confuse the whole purpose of eviction, as you said.

          Again, is this something generic enough to build in as a feature? It can easily enough be worked around in client code.

          • 2. Re: Removal policies
            Elias Ross Master


            Eviction is really designed around memory management, and thus is asynchronous, and really has no firm guarantees that eviction will happen at a certain moment.

            If I were to implement this without any facilities in JBossCache, I would probably create an external timer and my own method call interceptor.

            I took a stab at it, and it's a lot more difficult than I thought ...