All. I looked through web but didn't find applicable solution for me.
I need to access information, from globalsession scoped beans in HttpSessionListener
, before the session is destroyed.
I found one solution, after inspecting session attributes, but it doesn't seems smooth:
MyBean myBean = httpSessionEvent.getSession().getAttribute("scopedTarget."+"myBeanImlp");
I also have singleton beans, containing session beans via target+proxy, but getting them in sessionDestroyed
via ctx.getBean("mySingletonBean")
, the reference to session bean is invalid inside them (session bean was already destroyed before sessionDestroyed
call)
Does anybody know good and proper solution for such problem?
I'm thinking we need something like DestructionAwareBeanPostProcessor
, but for session beans, where I could look through beans, ready for destroy and take an action I need.