AbstractTraceAspect.java
资源名称:petclinic.rar [点击查看]
上传用户:dezhong
上传日期:2022-08-10
资源大小:167k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package org.springframework.samples.petclinic.aspects;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.aspectj.lang.JoinPoint;
- import org.aspectj.lang.annotation.Aspect;
- import org.aspectj.lang.annotation.Before;
- import org.aspectj.lang.annotation.Pointcut;
- /**
- * Aspect to illustrate Spring-driven load-time weaving.
- *
- * @author Ramnivas Laddad
- * @since 2.5
- */
- @Aspect
- public abstract class AbstractTraceAspect {
- private static final Log logger = LogFactory.getLog(AbstractTraceAspect.class);
- @Pointcut
- public abstract void traced();
- @Before("traced()")
- public void trace(JoinPoint.StaticPart jpsp) {
- if (logger.isTraceEnabled()) {
- logger.trace("Entering " + jpsp.getSignature().toLongString());
- }
- }
- }