3 Replies Latest reply on Jul 26, 2006 3:01 AM by Ben Wang

    PojoCacheListener 2.0 interface

    Ben Wang Master

      Following is the listener events for PojoCache. Note that, under PojoCache there is a decoupling of Cache node event now. That is, the user no longer has the notion of node modified, e.g., in PojoCache.

      /*
       * JBoss, Home of Professional Open Source
       *
       * Distributable under LGPL license.
       * See terms of license at gnu.org.
       */
      
      package org.jboss.cache.pojo;
      
      import java.lang.reflect.Field;
      
      /**
       * Listener interface for PojoCache events
       *
       * @author Ben Wang
       * @since 2.0
       * @version $Id: $
       */
      public interface PojoCacheListener {
       /**
       * Event when a POJO is attaching.
       *
       * @param pojo The POJO that is attaching.
       * @param pre True if this the callback before it is attached.
       * @param isLocal True if this is the local event, e.g., I am the active node.
       */
       void pojoAttach(Object pojo, boolean pre, boolean isLocal);
      
       /**
       * Event when a POJO is detaching.
       *
       * @param pojo The POJO that is detaching.
       * @param pre True if this the callback before it is detached.
       * @param isLocal True if this is the local event, e.g., I am the active node.
       */
       void pojoDetach(Object pojo, boolean pre, boolean isLocal);
      
       /**
       * Event when a POJO is modifying.
       *
       * @param pojo The POJO that is modifying.
       * @param pre True if this the callback before it is modified.
       * @param isLocal True if this is the local event, e.g., I am the active node.
       */
       void pojoModify(Object pojo, Field field, boolean pre, boolean isLocal);
      
       /**
       * Event when a POJO is passivating.
       *
       * @param pojo The POJO that is passivating.
       * @param pre True if this the callback before it is passivated.
       */
       void pojoPassivate(Object pojo, boolean pre);
      
       /**
       * Event when a POJO is evicting.
       *
       * @param pojo The POJO that is evicting.
       * @param pre True if this the callback before it is evicted.
       */
       void pojoEvict(Object pojo, boolean pre);
      
       /**
       * Event when a POJO is activating.
       *
       * @param pojo The POJO that is activating.
       * @param pre True if this the callback before it is activated.
       */
       void pojoActivate(Object pojo, boolean pre);
      }