1 package org.jboss.cache.optimistic; 2 3 import org.jboss.cache.CacheImpl; 4 import org.jboss.cache.interceptors.Interceptor; 5 import org.jboss.cache.marshall.MethodCall; 6 7 import java.lang.reflect.Method ; 8 import java.util.ArrayList ; 9 import java.util.List ; 10 11 19 public class MockInterceptor extends Interceptor 20 { 21 22 23 public void setCache(CacheImpl cache) 24 { 25 super.setCache(cache); 26 27 } 28 29 private Method called = null; 30 31 private List calledlist = new ArrayList (); 32 33 public synchronized Object invoke(MethodCall m) throws Throwable 34 { 35 36 calledlist.add(m.getMethod()); 37 called = m.getMethod(); 38 39 return null; 40 } 41 42 43 46 public Method getCalled() 47 { 48 return called; 49 } 50 51 public List getAllCalled() 52 { 53 return calledlist; 54 } 55 56 59 public void setCalled(Method called) 60 { 61 this.called = called; 62 } 63 } | Popular Tags |