1 16 17 package org.springframework.aop.interceptor; 18 19 import java.io.Serializable ; 20 21 import org.aopalliance.intercept.MethodInterceptor; 22 import org.aopalliance.intercept.MethodInvocation; 23 import org.apache.commons.logging.Log; 24 import org.apache.commons.logging.LogFactory; 25 26 import org.springframework.util.ClassLoaderUtils; 27 28 35 public class ClassLoaderAnalyzerInterceptor implements MethodInterceptor, Serializable { 36 37 38 protected static final Log logger = LogFactory.getLog(ClassLoaderAnalyzerInterceptor.class); 39 40 public Object invoke(MethodInvocation invocation) throws Throwable { 41 if (logger.isInfoEnabled()) { 42 logger.info( 43 ClassLoaderUtils.showClassLoaderHierarchy( 44 invocation.getThis(), 45 invocation.getThis().getClass().getName(), 46 "\n", 47 "-")); 48 } 49 return invocation.proceed(); 50 } 51 52 } 53 | Popular Tags |