package org.jboss.cache.interceptors;

import org.jgroups.blocks.MethodCall;
import org.jboss.cache.TreeCache;
import org.jboss.logging.Logger;

/**
 * Class representing an interceptor.
 * <em>Note that this will be replaced by {@link org.jboss.aop.advice.Interceptor} in one of the next releases</em>
 * @author Bela Ban
 * @version $Id: Interceptor.java,v 1.1.4.2 2004/09/23 18:42:34 bwang00 Exp $
 */
public abstract class Interceptor {
   Interceptor next=null;
   TreeCache   cache=null;
   Logger      log=null;

   public Interceptor() {
      log=Logger.getLogger(getClass());
   }

//   public Interceptor(Interceptor next) {
//      this.next=next;
//   }

   public void setNext(Interceptor i) {
      next=i;
   }

   public Interceptor getNext() {
      return next;
   }

   public void setCache(TreeCache cache) {
      this.cache=cache;
   }

   public Object invoke(MethodCall m) throws Throwable {
      return next.invoke(m);
   }
}
