pklndnst
pklndnst

Reputation: 756

What's the scope of a proxy created by Spring AOP?

Diving deeper into Spring AOP I already understood that Spring Framework chooses a proxy-based strategy for weaving in aspects. I read that these Proxies are created at runtime and just in time, i.e. "lazy".

Now the following question came up to me: Which scope does such a proxy object have, considering a web appliaction? Is there a way to find out?

I'm looking forward to your answers!

Upvotes: 1

Views: 172

Answers (1)

Jose Luis Martin
Jose Luis Martin

Reputation: 10709

Proxies are usually created by a BeanPostprocessor (in AbstractAutoProxyCreator hirearchy) so them have the same scope as the target bean.

If you create proxies by other ways, like using a ProxyFactoryBean you can change the scope, but in general isn't a good idea.

Upvotes: 3

Related Questions