I want to disable AOP for a particular Aspect (class level). Please note that I do not want to disable AOP across the application but for a particular aspect. Reason- when I enable aspect, the server takes longer to start as well as it runs slow.
Asked
Active
Viewed 1,848 times
1
-
Just comment out the `@Component` annotation in that @Aspect class – Mạnh Quyết Nguyễn Sep 05 '18 at 14:30
-
Possible duplicate of [Can we enable or disable Aspect based on value of any flag or through configuration file?](https://stackoverflow.com/questions/29406192/can-we-enable-or-disable-aspect-based-on-value-of-any-flag-or-through-configurat) – jondelatorre Feb 11 '19 at 21:14
1 Answers
2
Can you move that particular class to some other package where AOP Point-cut is not configured? Basically using point-cut you can easily avoid unwanted packages. you can also use RegexpMethodPointcutAdvisor

Asad Abdin
- 140
- 11
-
I want it to be pluggable or I want to use some property flag to enable or disable it. – CodeRider Sep 06 '18 at 05:09
-
1the slowness that you face i think because of the code you execute using AOP, you can turn off the complete code block by some custom property, unfortunately i am not aware of any such property to control a specific point-cut, let me know if you find such thing. – Asad Abdin Sep 10 '18 at 14:23