Xpages @PreDestroy

后端 未结 2 931
梦如初夏
梦如初夏 2020-12-18 13:55

Summary: does anyone know how to get @PreDestroy to get triggered on recycling\\ timeout of an Application Scope managed bean?

I posted a question a couple of weeks

相关标签:
2条回答
  • 2020-12-18 14:12

    There are three types of JSF listener artifacts that provide an opportunity to manually clean up objects stored in scope (including managed beans):

    1. FacesContextListener: its beforeContextReleased() method is the absolute last call before any request terminates, so this is an ideal place to clean up the requestScope.
    2. SessionListener: its sessionDestroyed() method provides a chance to clean up the sessionScope.
    3. ApplicationListener: its applicationDestroyed() method provides a chance to clean up the applicationScope.

    An ApplicationListener must be defined in an OSGi XSP Library; the first two can be defined either in a library or local to a specific NSF.

    0 讨论(0)
  • 2020-12-18 14:21

    I may be wrong, but XPages is built based on JSF1.2, while Managed bean annotations are available only from JSF2.0.

    0 讨论(0)
提交回复
热议问题