How to cleanup an application scoped bean

2007-02-21 Thread H. Swaczinna
Hi, I have an application scoped bean and want to do some cleanup when the application is shutdown (undeployed). Is there a way to register the bean somehow with the application context like I can register a session scoped bean with the session context? Regards Helmut

Re: How to cleanup an application scoped bean

2007-02-21 Thread Adrian Mitev
you can access it with #{applicationScope.beanName} 2007/2/21, H. Swaczinna <[EMAIL PROTECTED]>: Hi, I have an application scoped bean and want to do some cleanup when the application is shutdown (undeployed). Is there a way to register the bean somehow with the application context like I can

Re: How to cleanup an application scoped bean

2007-02-21 Thread Matthias Wessendorf
you can use a servletcontext listener to do some cleanup on shutdown -M On 2/21/07, H. Swaczinna <[EMAIL PROTECTED]> wrote: Hi, I have an application scoped bean and want to do some cleanup when the application is shutdown (undeployed). Is there a way to register the bean somehow with the appl

RE: Re: How to cleanup an application scoped bean

2007-02-21 Thread H. Swaczinna
Ok, but how can I access (find) the bean from such servletcontext listener? There's no FacesContext at that time I think. Regards Helmut >you can use a servletcontext listener to do some cleanup on shutdown > >-M > >On 2/21/07, H. Swaczinna <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have an appl

Re: Re: How to cleanup an application scoped bean

2007-02-21 Thread Matthias Wessendorf
contextDestroyed(ServletContextEvent sce) { ServletContext servletCxt = sce.getServletContext() MyBean mb = (MyBean) servletCxt.getAttribute("nameOfTheManagedBean"); mb.doIt(); } On 2/21/07, H. Swaczinna <[EMAIL PROTECTED]> wrote: Ok, but how can I access (find) the bean from such servletconte

RE: Re: Re: How to cleanup an application scoped bean

2007-02-21 Thread H. Swaczinna
Ok, looks simple. Thank you. >contextDestroyed(ServletContextEvent sce) >{ > > ServletContext servletCxt = sce.getServletContext() > MyBean mb = (MyBean) servletCxt.getAttribute("nameOfTheManagedBean"); > mb.doIt(); > >} > >On 2/21/07, H. Swaczinna <[EMAIL PROTECTED]> wrote: >> Ok, but how can I