1 package org.apache.ojb.broker.util.interceptor; 2 3 17 18 import java.lang.reflect.Method ; 19 import org.apache.ojb.broker.util.logging.LoggerFactory; 20 21 22 26 public class TracingInterceptor extends Interceptor 27 { 28 29 public TracingInterceptor(Object instanceToTrace) 30 { 31 this.setRealSubject(instanceToTrace); 32 } 33 34 37 protected void beforeInvoke(Object proxy, Method methodToBeInvoked, Object [] args) 38 throws Throwable 39 { 40 LoggerFactory.getDefaultLogger().info("before: " + getRealSubject().toString() + "." + methodToBeInvoked.getName()); 41 } 42 43 46 protected void afterInvoke(Object proxy, Method methodToBeInvoked, Object [] args) 47 throws Throwable 48 { 49 LoggerFactory.getDefaultLogger().info("after : " + getRealSubject().toString() + "." + methodToBeInvoked.getName()); 50 } 51 52 } 53 | Popular Tags |