hi radu, imo we have 3 easy options:
#1 we continue to rely on jsf-events and just add a session-scoped bean which triggers the cleanup via its @PreDestroy callback (if the cleanup wasn't done already). (we also need one to cleanup the window-context.) #2 since we also need to track the view-ids for the view-access-scope, we just use a similar implementation (which follows the rules of the view-scope) and map it to @ViewScoped. #3 like #2 but with the help of the window-context (instead of the view-map) -> similar to [1]. regards, gerhard [1] http://os890.blogspot.co.at/2011/06/session-based-view-scope-with-codi.html 2012/11/19 Mark Struberg <[email protected]> > > > Hi Radu! > > Yes, we already discussed this and agreed to import it. > Txs 4 your report! > > LieGrue, > strub > > > > > > >________________________________ > > From: Radu Creanga <[email protected]> > >To: [email protected] > >Sent: Sunday, November 18, 2012 11:56 PM > >Subject: Re: [jira] [Created] (DELTASPIKE-293) Improve the > ViewScopedContext by observing ServletContext and HttpSession lifecycle > events. > > > >Hello everyone, > > > >It seems this will require ServletContext events and Session events to > >be published to the CDI event bus, which in turn requires adding the > >appropriate listeners to web.xml until CDI 1.1. I know Seam Solder has > >these listeners implemented. Are there plans to import it into > >DeltaSpike? > > > >Radu Creanga > > > > > >On Sun, Nov 18, 2012 at 4:32 PM, Radu Creanga (JIRA) <[email protected]> > wrote: > >> Radu Creanga created DELTASPIKE-293: > >> --------------------------------------- > >> > >> Summary: Improve the ViewScopedContext by observing > ServletContext and HttpSession lifecycle events. > >> Key: DELTASPIKE-293 > >> URL: > https://issues.apache.org/jira/browse/DELTASPIKE-293 > >> Project: DeltaSpike > >> Issue Type: Improvement > >> Components: JSF-Module > >> Affects Versions: 0.4-incubating > >> Reporter: Radu Creanga > >> Fix For: 0.5-incubating > >> > >> > >> The CDI specification states that Context implementations are > responsible for destroying instances it creates. The current > ViewScopedContext relies on PreDestroyViewMapEvents to be notified when a > view map is destroyed. But, the JSF 2.0 and 2.1 spec only fire this event > when a view map is replaced. This means that in most cases, instances > created by ViewScopedContext are not properly destroyed. The > ViewScopedContext should be observing ServletContext and HttpSession > lifecycle events instead in order to ensure that all instances it creates > are properly destroyed. Visible improvements resulting out of this would be > that the @PostConstruct method of @ViewScoped beans is invoked. > Additionally, this will probably result in better memory usage, since > instances that are not properly destroyed are not eligible for GC. > >> > >> -- > >> This message is automatically generated by JIRA. > >> If you think it was sent incorrectly, please contact your JIRA > administrators > >> For more information on JIRA, see: > http://www.atlassian.com/software/jira > > > > > > >
