Hi,
I'm making some tests with SAS contexts in a modular application and I notice there isn't any close() or dispose() method on the context.
Is there any plan to support such kind of feature in upcoming releases of SAS ?
thanks
Hi,
I'm making some tests with SAS contexts in a modular application and I notice there isn't any close() or dispose() method on the context.
Is there any plan to support such kind of feature in upcoming releases of SAS ?
thanks
Hey there,
good point, I've been thinking about this as well, there definitely needs to be some kind of dispose() functionality for a context. This will probably make it in version 1.1, but exactly how this will work I don't know yet.
Should you have suggestions or ideas for this we'd love to hear them.
cheers,
Roland
Well, I guess this is not as easy as removing any reference to the context ...
Actually, I'm trying to build a modular framework on top of SAS where each module/app would have its own _independent_ context (for isolation purposes).
And I'm having issues because some resources linked to Stage Processing are shared amongst contexts.
As an example, there is a missing unregisterContext() method in the IStageProcessorRegistry that should remove the context when it is closed.
I haven't been any further yet but I guess there are potentially other issues (like listeners that must be removed (ex:Event.ADDED), ...)
Hey there,
yes, your points are extremely validIts what I'm brainstorming about as well, the stageprocessorregistry is just one element. The Event.ADDED event won't be a problem since we're listening to this event on the SystemManager. But there's bound to be a lot of objects that have event listeners all over the place, so I'm going to have to sift through the entire code base to get a good idea of what strategy fits this problem.
I guess an IDisposable interface will come in handy, so that when the singelton cache of a context gets freed up we can loop through the instances, check for this interface and call its dispose() method, for instances that are unable to implement this interface themselves we can always implement an onDispose event on the context, so that a developer can remove any listeners by hand.
I'm just thinking out loud here, feel free to chime in
cheers,
Roland
FYI,
I've added an unregisterContext() method to the IStageProcessorRegistry interface and an implementation of it in the FlexStageProcessorRegistry.
Changes are available in the trunk.
cheers,
Roland
Ok great,
I'll check this out when I have some time.
the IDisposable interface seems indeed a good idea. I think there is something similar in Spring (for java).
If I discover any further issue on this topic, I'll let you know.
Thanks,
Alain
Just to let you know unregistering context for modules does not work.
I have created an issue and submitted a patch to fix the problem :
http://jira.springframework.org/brow...ONSCRIPTAS-101
Regards,
Alain
Hi Alain,
I have applied your patch (and reworked the code a bit for registering and unregistering contexts). Please let me know if this works for you or if you run into more problems.
regards,
Christophe
Ok, this is working.
thanks for the quick fix.
Regards,
Alain