--- Dave Cramer <Dave@micro-automation.net> wrote:
> Looks good so far... I haven't had a chance to really read it, but I am
> wondering about a synchronized method that can block? Specifically
> getPooledConnection.
Actually, I punted on that one. Reason I did it was that creating a
new Properties could fail due to an IOException. However, if I make
the 'reload()' method catch the exception, then I can have the static
var be created at construction time. (Like this)
private static DefaultProperties self = new DefaultProperties();
public static DefaultProperties getDefaultProperties() {
return self;
}
I use the term 'punted' since I didn't know if developers would rather
a) check that the singleton is null, b) get an empty DefaultProperties
object or c) handle the exception of an IOException. For this case, I
allowed the singleton to be null, and made it not a true singleton by
giving people the option to create their own instance.
Votes on proper behavior? I guess it makes sense to catch the exception
internally, and behave as if the DefaultProperties is empty should an
IOException occur.
=====
Virtually, | "Must you shout too?"
Ned Wolpert | -Dante
wolpert@yahoo.com |
_________________/ "Who watches the watchmen?"
4e75 -Juvenal, 120 AD
-- Place your commercial here -- fnord
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com