Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DataSourceConnectionAspectAnno.java 577B

1234567891011121314151617181920
  1. package foo;
  2. import javax.sql.DataSource;
  3. import org.aspectj.lang.JoinPoint;
  4. import org.aspectj.lang.annotation.Aspect;
  5. import org.aspectj.lang.annotation.Before;
  6. import org.aspectj.lang.annotation.DeclareParents;
  7. @Aspect
  8. public class DataSourceConnectionAspectAnno {
  9. // This statement crashes the AspectJ compiler
  10. @DeclareParents("foo.BaseClass")
  11. private DataSource dataSource;
  12. @Before("execution(public java.sql.Connection javax.sql.DataSource+.getConnection(..))")
  13. public void myAdvice(JoinPoint thisJoinPoint) {
  14. System.out.println(thisJoinPoint);
  15. }
  16. }