日期:2014-05-17 浏览次数:21586 次
package fantasy0707.spring.aop; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.springframework.stereotype.Component; @Aspect @Component public class LogInterceptor { @Pointcut("execution(public * fantasy0707.spring.service.*.*(..))") public void pointCut() {} @Before("pointCut()") public void before() { System.out.println("before method..."); } }
2010-4-6 17:12:05 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@cd5f8b: startup date [Tue Apr 06 17:12:05 CST 2010]; root of context hierarchy 2010-4-6 17:12:05 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [beans.xml] 2010-4-6 17:12:06 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons 信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6210fb: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,logInterceptor,userDao,service,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy init... before method... a user added! 2010-4-6 17:12:07 org.springframework.context.support.AbstractApplicationContext doClose 信息: Closing org.springframework.context.support.ClassPathXmlApplicationContext@cd5f8b: startup date [Tue Apr 06 17:12:05 CST 2010]; root of context hierarchy 2010-4-6 17:12:07 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons 信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6210fb: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,logInterceptor,userDao,service,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy destory...