Hi I have a bean and I want to define it as a CustomScoped Bean based on time, I mean I want to destroy the bean after a specific period of idle time . I mean if the user is not working with his/her own instance of the bean, the bean should be destroyed. Yes, each user needs to have its own instance, so it will be a kind of SessionScoped Bean which will be removed from Session after a while...
If you can use CDI (JSR-299) , you could use the Conversation Scope, make it long lived, and set the conversation timeout to your desired value. This would save you from having to write your own custom scope. As an added bonus, you get all the other great things that come with CDI.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.