Class MyUsageAspect
java.lang.Object
info.ejava.examples.svc.aop.items.introductions.MyUsageAspect
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
FieldsModifier and TypeFieldDescriptionstatic MyUsageIntroduction
This will define an Introduction interface and default implementation that will be added to subjects matching the provided expression. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
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
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 requestedusageIntro
- Introduction interface implemented by the proxy (this) answering this intercept
-