The dual proxy pattern is used so that we can do thread safe, just-in-time creation of the real service. The inner proxy is synchronized on all methods and, within that synchronized block, replaces itself in the outer proxy with the actual service implementation (or the outermost interceptor). This trades off construction cost and the one-time cost of creating the service implementation against a constant need to synchronize access.
On 7/20/05, James Carman <[EMAIL PROTECTED]> wrote: > Yes, but that's not what the "outer" proxy (the one the client gets that > delegates to the interceptor stack once it's created) is for, is it? The > "inner" proxy (the one at the bottom of the interceptor stack) is the one > that delegates to the appropriate implementation object for threaded/pooled > service models, correct? > > -----Original Message----- > From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 20, 2005 9:43 AM > To: [email protected]; Glen Stampoultzis > Subject: Re: [QUESTION] Proxy Generation Motivation > > On 7/19/05, Glen Stampoultzis <[EMAIL PROTECTED]> wrote: > > > Another thing is that proxies allow you to adjust the scope/lifetime > > of an object while still holding on to the original reference. > > > > > Very well put! > -- > Howard M. Lewis Ship > Independent J2EE / Open-Source Java Consultant > Creator, Jakarta Tapestry > Creator, Jakarta HiveMind > > Professional Tapestry training, mentoring, support > and project work. http://howardlewisship.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
