Sylvain Wallez wrote:
Carsten Ziegeler wrote:



First question, but not the one you expected ;-)

:( ;)

Can you explain what these proxies are for exactly? Is it to avoid lookup/release at each usage? If yes, how/when are the components actually put back in the pool (sorry, not much time to look at the code ATM)?

Oh, sure, totally forgot about it: yes, the proxies manage the lookup/release. When you look up a pooled component, you get a proxy. The first time, you invoke a method on this proxy, the real component is looked up inside proxy and then used. The component is stored locally in the proxy and the proxy uses a thread local variable. So if different threads use the same proxy, they get different instances. If there were two lookups, two proxies are created and each proxy has its own thread local.
Everything is cleaned up by the end of the request.


Carsten

--
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Reply via email to