aspectj - What are the option for spring @Advice to communicate with some other service? -
we using spring spring aop . regular spring bean/service/repository (i.e @service , etc) @autowired annotation works well. but, won't work out of box @advice class. my question is: what option @advice communicate @service ? thanks! some example search db (using jpa;hibernate ) within advice raise event in system, using applicationeventpublisher call function defined in x service . i have put simple experiment app: @retention(retentionpolicy.runtime) public @interface injectadvicehere { } @service public class fooservice { public void foo(){ system.out.println("foo"); } } @service public class barservice { @injectadvicehere public void bar(){ system.out.println("bar"); } } @aspect @component public class myaspect { private final fooservice fooservice; @autowired public myaspect(fooservice fooservice) { super(); this.fooservice = fooservice; } @befor...