You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sascha Schmidt <sa...@data-experts.de> on 2005/02/22 11:22:17 UTC

Lifecycle of Backing Beans

Hello!

I'm working on a JSF project that has some backing beans in session scope. 
Now we have the need to register these beans at a messaging system to 
exchange some data. But if the backing beans are registered at a messaging 
system they will never be freeed by the garbage collector. The question 
is: are there any lifecycle methods that are invoked when a backing bean 
is destroyed (end of session)? Is it possible to monito and observe 
backing beans?

Thank you!

Cheers,
Sascha

Re: Lifecycle of Backing Beans

Posted by Michal Malecki <mi...@poczta.onet.pl>.
Check JSF-Spring - IMHO spring is much more robust in beans lifecycle
Michal Malecki


  Hello! 

  I'm working on a JSF project that has some backing beans in session scope. Now we have the need to register these beans at a messaging system to exchange some data. But if the backing beans are registered at a messaging system they will never be freeed by the garbage collector. The question is: are there any lifecycle methods that are invoked when a backing bean is destroyed (end of session)? Is it possible to monito and observe backing beans? 

  Thank you! 

  Cheers, 
  Sascha

Antwort: Re: Lifecycle of Backing Beans

Posted by Sascha Schmidt <sa...@data-experts.de>.
Hi Craig,

It's seems that the HttpSessionBindingListener is exactly what I've 
needed.

Thank you,
Sascha




Craig McClanahan <cr...@gmail.com> 
22.02.2005 22:46
Bitte antworten an
"MyFaces Discussion" <my...@incubator.apache.org>


An
MyFaces Discussion <my...@incubator.apache.org>
Kopie

Thema
Re: Lifecycle of Backing Beans






In addition to the JSF-Spring suggestion, you should check out the
following standard Servlet API capabilities:

* HttpSessionBindingListener - lets an instance itself
  be notified when it is bound or unbound into a session
  (the latter happens when the session expires).

* HttpSessionAttributeListener - lets an external listener
  instance be notified when attributes are bound or unbound
  from any session in the application.

* HttpSessionListener - lets an external listener
  instance be notified when sessions are created or expired.

Craig


On Tue, 22 Feb 2005 11:22:17 +0100, Sascha Schmidt
<sa...@data-experts.de> wrote:
> 
> Hello! 
> 
> I'm working on a JSF project that has some backing beans in session 
scope.
> Now we have the need to register these beans at a messaging system to
> exchange some data. But if the backing beans are registered at a 
messaging
> system they will never be freeed by the garbage collector. The question 
is:
> are there any lifecycle methods that are invoked when a backing bean is
> destroyed (end of session)? Is it possible to monito and observe backing
> beans? 
> 
> Thank you! 
> 
> Cheers, 
> Sascha



Re: Lifecycle of Backing Beans

Posted by Craig McClanahan <cr...@gmail.com>.
In addition to the JSF-Spring suggestion, you should check out the
following standard Servlet API capabilities:

* HttpSessionBindingListener - lets an instance itself
  be notified when it is bound or unbound into a session
  (the latter happens when the session expires).

* HttpSessionAttributeListener - lets an external listener
  instance be notified when attributes are bound or unbound
  from any session in the application.

* HttpSessionListener - lets an external listener
  instance be notified when sessions are created or expired.

Craig


On Tue, 22 Feb 2005 11:22:17 +0100, Sascha Schmidt
<sa...@data-experts.de> wrote:
>  
> Hello! 
>  
> I'm working on a JSF project that has some backing beans in session scope.
> Now we have the need to register these beans at a messaging system to
> exchange some data. But if the backing beans are registered at a messaging
> system they will never be freeed by the garbage collector. The question is:
> are there any lifecycle methods that are invoked when a backing bean is
> destroyed (end of session)? Is it possible to monito and observe backing
> beans? 
>  
> Thank you! 
>  
> Cheers, 
> Sascha