You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by "Mosttler, Marcus" <mm...@HarryandDavid.com> on 2006/01/10 00:15:12 UTC

ElementEventHandler

Hi,
We recently converted our system to use JCS.  It is working out quite
well and was fairly easy to setup.  I would like to thank all who have
worked on this.

We have run into a problem though.  We are trying to do some additional
clean up work when an element in the cache expires.  When it is
attempted to be retrieved it is removed due to it being expired.  I
found in the element event constants a list of events, one of which fits
perfectly for our situation, 

31      /***
32       * Expiration discovered on request
33       */
34      public final static int ELEMENT_EVENT_EXCEEDED_MAXLIFE_ONREQUEST
= 1;


41      /***
42       * Expiration discovered on request
43       */
44      public final static int
ELEMENT_EVENT_EXCEEDED_IDLETIME_ONREQUEST = 3;

Since this appeared to meet our needs I have created a handler to
implement the interface and have added it to the element.  My hope was
that when the element expired and was removed on the get that an event
would trigger calling my handler.

This does not seem to be the case.  The handler is never called.  So I
have studied the code some and have only found the event handler to be
used along with some disk spooling events.

Is this something that has not been completed or is my understanding of
the event handler and the events listed in the constants incorrect?

Thank you for your time.

Marcus Mosttler