> I did test this code from a Main() class and it worked just fine...if you
> read the javadoc I make explicit statements that say that you need to call
> setPropertyFileName() before calling getString().
I keep bringing this up cuz I think it's important so my 2 cents...
>From a main() TurbineResources will never get garbage collected cuz there
will always be a reference to it. Just cuz we init() in TurbineResources at
a given time doesn't mean that it can't get garbage collected cuz it is
possible that all references to it could later be released. That's why we
have singletons...they allow us to have "global" objects that sit in memory
without being referenced by anything else.
By making all the methods in TurbineResources static you've made things
convenient but that means nothing is permanently keeping a reference to
TurbineResources. TurbineServices *needs* to keep a reference to an
*instance* TurbineResources which it does not in the current recommended
usage.
The whole point of the service framework was for a single singleton to keep
track of instances of various services. By bypassing that we're leaving
things open for NPEs.
At some point somewhere this needs to happen before we use anything in
TurbineResources if we are going with the service setup:
((TurbineResources)TurbineServices.getInstance()
.getService(TurbineResourceService.RESOURCES))
Feedback please
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]