开发者

seam shutdown listener

I would like to observe when the application is about to shutdown. I thought this code block would work, but it never catches that event.

开发者_如何学C

My component is an event scoped component, I only want it to live for the scope of that event.

@Observer("org.jboss.seam.preDestroyContext.APPLICATION")
    @Transactional
    public void onShutdown()
    {
          ...
         }

Is this possible in the current design of Seam? If not, should this be a feature request or are there other inherit problems with this idea?

Walter


Actually, there is a JIRA issue filed for this problem. Two things are wrong.

  1. An application-scoped component with a remove/destroy method does not execute properly without an active event scope.
  2. Any component should be able to observe any event, if the event is synchronous, then the event will be handled first, then that component destroyed.

The application-scoped component is the quickest fix for the time being. The second one will be a bit more complex.

Walter


How about considering ServletContextListener, in the first place?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜