java - Add constructor to AspectJ aspect with parameters -


i have

@aspect public class myaspect {  int x,y,z; public myaspect(int _x,int _y,int _z){     x=_x;     y=_y;     z=_z; }    @after("execution(public * save(..))") public void methodafter(joinpoint joinpoint) {     //code } 

after calling save method,it doesn't execute methodafter. however,without constructor,it works.how can use aspectj constructors?

i assume working in spring environment, suggest you'll is:

  1. add @component annotation aspect.
  2. use @inject , @value annotations inject required values x,y,z.

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -