Currently:
Turbine.init() calls
TurbineResources.setPropertiesFileName() calls
TurbineResources.init() calls
TurbineServices.getInstance().getService(RESOURCES) calls
TurbineResourceService.init() calls
new TurbineResources() which calls
TurbineResources.init()
infinite loop
So I commented out the call to init() in the TurbineResources constructors
as a quick fix but...
IMO TurbineResources should have been left a straight singleton until the
services.resources stuff was firmed up. Currently, there is nothing in
services.resources that manages multiple resources from files. If we want a
"resource service" then having a TurbineResourceService associated with a
single props file doesn't get us very far.
Also, making the methods in TurbineResources static is convenient but it
deviates from the "service standard" of calling
TurbineServices.getInstance().getService(serviceName) and being returned an
*instance* of a particular service on which you can call instance methods.
If we are going to have a "service framework" then we need to comply with
those specs.
I'll look into it when I have more time.
> User: jonbolt
> this should fix the GC issue. if it doesn't, please let me know
> ...i have another idea on how to fix the issue, but it is a lot
> more code changes and i would rather not go through that
> if this is just a simple fix like this.
> +import org.apache.turbine.services.TurbineServices;
>
> /**
> * This is a mostly static class for accessing the
> TurbineResources.properties
> @@ -164,7 +165,11 @@
> */
> private static void init(Configurations confs)
> {
> - generic = new GenericResources (confs);
> + generic = new GenericResources (confs);
> + // this is here so that we grab an instance of the
> TurbineResourceService
> + // and cache that within the TurbineServices class so
> that the instance
> + // of myself is never GC'd
> +
> TurbineServices.getInstance().getService(TurbineResourceService.RE
> SOURCES);
> }
>
> /**
>
>
>
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]