Return-Path: X-Original-To: apmail-jakarta-jcs-users-archive@www.apache.org Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97773975F for ; Wed, 11 Jan 2012 12:00:18 +0000 (UTC) Received: (qmail 18019 invoked by uid 500); 11 Jan 2012 11:52:27 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 17063 invoked by uid 500); 11 Jan 2012 11:52:15 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Delivered-To: moderator for jcs-users@jakarta.apache.org Received: (qmail 70372 invoked by uid 99); 11 Jan 2012 07:34:57 -0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of datta.mane2@gmail.com designates 209.85.214.172 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=HUuFlTyZKYheSDzJ81vjiKPXuI3Jdm1yRSL4UNkxTO0=; b=IOJGWQ7KuwE3ViOAIHJL8vdHw3N2GkDb1aENo71y5CWn20oOdqf5hecXNqdYCEGoCc qsOodx4THg51ws6piKliAmDYNyHA1yJm53qF7G/sNdjVWhjg1+wVsgYR1pytRbXk6iWO +cP1Muyj/PWu5Zma2UwxxDyYhVHTK49XbA/QE= MIME-Version: 1.0 Date: Wed, 11 Jan 2012 02:34:29 -0500 Message-ID: Subject: Event handling related Question. Memory Shringker thread From: Datta Mane To: jcs-users@jakarta.apache.org Content-Type: multipart/alternative; boundary=e89a8f6467557ee6f404b63ba9aa --e89a8f6467557ee6f404b63ba9aa Content-Type: text/plain; charset=ISO-8859-1 This is scenario I am stuck with EPG (Electronic programming guide): has data which is frequently updated MY WEB APP: On load calls the EPG Services and load data into JCS cache After few minutes Say 15 minutes I have to make a call to EPG Service and get the new Data *jcs.region.metadataCache.cacheattributes.UseMemoryShrinker=true* and jcs.region.metadataCache.elementattributes.IdleTime=120 Based on this documentation http://commons.apache.org/jcs/apidocs/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.html My understanding is when Memory Shrinker Property is set to true and Idle Time is exceeded Shrinked thread will remove the Cached Object from memory and invoke Eventhandlers handleElementEvent(IElementEvent iElementEvent) And it does invoke the handleElementEvent(IElementEvent iElementEvent) So I put the code below in handleElementEvent to load Data /******************/ case IElementEventConstants.ELEMENT_EVENT_EXCEEDED_IDLETIME_BACKGROUND: event = (ElementEvent) iElementEvent; element = (CacheElement) event.getSource(); //TODO loadDataFromEPG("TVGUIDE"); // reload data into Cache break; /******************/ The issue is Shrinker Thread Calls handleElementEvent only for the first time when the cached exceed Idle time After reloading When the newly Cached Object exceeds the ideltime handleElementEvent is not invoked. Is this a BUG ? or Am I doing any thing wrong How can I resolve this JCS API. Other option I have is to use Quartz Job to refresh data in Local JCS cache at specified interval which I want to avoid. Thanks Datta --e89a8f6467557ee6f404b63ba9aa--