org.aspectj.lang.annotation.Before.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.aspectj.lang.annotation.Before.<init>()方法的一些代码示例,展示了Before.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Before.<init>()方法的具体详情如下:
包路径:org.aspectj.lang.annotation.Before
类名称:Before
方法名:<init>

Before.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.set*(int))")
  public void countSetter() {
    ++count;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.*(..))")
  public void countAnythingVoid() {
    ++count;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface) " +
    "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl)")
public void incrementThisAsInterfaceAndTargetAsClassCounter() {
  thisAsInterfaceAndTargetAsClassCounter++;
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.set*(int))")
  public void countSetter() {
    ++count;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(* getAge())")
  public void throwException() throws Exception {
    throw ex;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface) " +
    "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface)")
public void incrementThisAsInterfaceAndTargetAsInterfaceCounter() {
  thisAsInterfaceAndTargetAsInterfaceCounter++;
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(* setAge(int)) && args(newAge)")
  public void countSet(int newAge) throws Exception {
    ++totalCalls;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.set*(int))")
public void countSetter() {
  ++count;
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.set*(int))")
public void countSetter() {
  ++count;
}

代码示例来源:origin: spring-projects/spring-framework

@Before("@target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestAnnotation)")
public void incrementAtTargetClassAnnotationCounter() {
  atTargetClassAnnotationCounter++;
}

代码示例来源:origin: spring-projects/spring-framework

@Before("@args(org.springframework.context.annotation.EnableAspectJAutoProxyTests.Loggable))")
  public void loggingBeginByAtArgs() {
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("genericInterfaceSubtypeGenericCollectionArgExecution()")
  public void incrementGenericInterfaceSubtypeGenericCollectionArgExecution() {
    genericInterfaceSubtypeGenericCollectionArgExecutionCount++;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl) " +
    "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl)")
public void incrementThisAsClassAndTargetAsClassCounter() {
  thisAsClassAndTargetAsClassCounter++;
}

代码示例来源:origin: spring-projects/spring-framework

@org.aspectj.lang.annotation.Before("execution(* scheduled())")
  public void checkTransaction() {
    this.count.incrementAndGet();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("serviceExecution()")
public void countUse() {
  this.useCount++;
  threadLocalCount.set(this.useCount);
}

代码示例来源:origin: spring-projects/spring-framework

@Before("methodExecution()")
  public void entryTrace(JoinPoint jp) {
    this.lastEntry = jp.toString();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)")
  public void touchBean(TestBean testBean) {
    testBean.setName("advisedName");
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)")
  public void touchBean(TestBean testBean) {
    testBean.setName("advisedName");
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before("execution(void *.additionalMethod(*))")
  public void log(JoinPoint jp) {
    System.out.println("Before " + jp.getSignature().getName());
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Before(value="execution(void set*(*)) && this(mixin)", argNames="mixin")
public void checkNotLocked( Lockable mixin) {
  // Can also obtain the mixin (this) this way
  //Lockable mixin = (Lockable) jp.getThis();
  if (mixin.locked()) {
    throw new IllegalStateException();
  }
}

相关文章

微信公众号

最新文章

更多

Before类方法