java.lang.Object
info.ejava.examples.svc.aop.items.introductions.MyUsageAspect

@Component public class MyUsageAspect extends Object
This example AOP component defines an Introduction to be added to components matching an expression and implements advice that will track calls made to methods matching a pointcut.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    This will define an Introduction interface and default implementation that will be added to subjects matching the provided expression.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A pointcut to match any createItem method in the target package, taking and returning any argument.
    void
    recordCalled(org.aspectj.lang.JoinPoint jp, MyUsageIntroduction usageIntro)
    Advice that will run before each target implementing the MyUsageIntroduction interface and is the subject of a createItem method call.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mixin

      public static MyUsageIntroduction mixin
      This will define an Introduction interface and default implementation that will be added to subjects matching the provided expression.
  • Constructor Details

    • MyUsageAspect

      public MyUsageAspect()
  • Method Details

    • anyCreateItem

      public void anyCreateItem()
      A pointcut to match any createItem method in the target package, taking and returning any argument.
    • recordCalled

      public void recordCalled(org.aspectj.lang.JoinPoint jp, MyUsageIntroduction usageIntro)
      Advice that will run before each target implementing the MyUsageIntroduction interface and is the subject of a createItem method call.
      Parameters:
      jp - the object containing details of method call requested
      usageIntro - Introduction interface implemented by the proxy (this) answering this intercept