You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by an...@axa.com.au on 2004/02/24 04:07:50 UTC

CacheElement Event Handler

I'm adding an event handler for a specific cache item like this:
 ElementAttributes attr = 
(ElementAttributes)cache.getElementAttributes().copy();
   if(name.equalsIgnoreCase(EPlatformTask.CONTROL_CACHE_ITEM_NAME))
       attr.addElementEventHandler(new 
com.axa.eplatform.util.ecache.jcache.ControlItemEventHandler());
   attr.setMaxLifeSeconds(ttl);
   cache.put(name, obj, attr);

Here is event handler's code:

package com.axa.eplatform.util.ecache.jcache;

import org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
import org.apache.jcs.engine.control.event.behavior.IElementEvent;
public class ControlItemEventHandler implements IElementEventHandler {

  public java.io.Serializable handleElementEvent(IElementEvent event){
 
System.out.println("\n\n\n\n**********************************************");
    System.out.println(event);
 
System.out.println("**********************************************\n\n\n\n");
    return new String("Test");
  }
}

But this "handleElementEvent" doesnt get invoked.....why????


*********************************************************************************
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
*********************************************************************************