commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <>
Subject Re: [pool] Pool config vs. factory hierarchies.
Date Fri, 29 Oct 2010 15:09:43 GMT
On Fri, Oct 29, 2010 at 10:58 AM, Gary Gregory
<> wrote:
> I thought we said that pools settings should be configurable. The current Config root
class has setters.
> Are we saying that, yes, pools are configurable post-creation but not through config
objects? Should config objects be cloned when passed in a constructor then?

My opinion is that the config objects should be immutable.  Then, you
don't have to worry about synchronization issues.  You'd just have the
reconfigure(Config) method (which is called by the constructor).  The
reconfigure method would take care of making sure it locks down
(synchronizes) everything while he does all the reconfiguring of the

I would probably suggest a read/write lock.  Folks who want to borrow
an object from the pool or return and object to the pool would be
obtaining the "read" lock.  When you are in the middle of
reconfiguring the pool, you'd obtain the "write" lock.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message