Hashtable is indeed synchronized ... but it's *always* synchronized
even when you don't need it.  LogFactoryBase (which I'll bet you
glanced at :-) uses Hashtable because [logging] needed to be able to
work in a JDK 1.1 environment.  That's not an issue for [chain], since
we're already usng the JDK 1.2 collections classes, so I prefer to use
them throughout, so we have the opportunity to not synchronize in
cases where thread safety is not an issue -- it is here, though.

More subtly, though, you'll also note that I use Map instead of
HashMap to declare the actual instance variable, and the return values
from appropriate methods.  That way, the actual implementation class
could be specialized later without breaking method signatures.  That's
not as easy to do if you're throwing Hashtables around (any
specialized version would have to subclass Hashtable, and not some
more generic interface).

Craig


On Sun, 17 Oct 2004 11:48:24 -0400, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Craig,
> 
> Thanks for commiting those changes.  I noticed you had to make a few modifications.  
> Sorry 'bout that - did my best.  One change you made I was curious about.  I was 
> using a Hashtable to store the classloaders and you changed it to Map with a 
> synchronized block.  I was curious as to why you feel this is better?  Isn't 
> Hashtable already synchronized?
> 
> Just curious.
> 
> sean
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to