Colleagues, In the spring security documentation I met following notion:
If you want to secure instances which are not created by Spring (using the
There is an Aspectj sample in the Spring Security codebase. It compiles against the spring-security-aspects
module and then uses:
to enable secured annotations. The code is very simple - it is really just a set of JUnit tests. If you take a look, you'll see that these include tests for both Spring-bean instances and instances created using the new
operator.
If you want to know how spring-security-aspects
works, check out the aspect source.