How can I start a process on the start of a Seam application

守給你的承諾、 提交于 2019-12-01 05:29:17

问题


I tried annotating the class with the scopetype APPLICATION and a method with the @Create, @Beg, but this doesn't seem to work.

What I want is to start an infinite loop right when the application starts.


回答1:


If you want a method to be executed right after initialization you can use the folowing annotation:

@Observer("org.jboss.seam.postInitialization")



回答2:


You can annotate your class with the @Startup annotation.



来源:https://stackoverflow.com/questions/2093650/how-can-i-start-a-process-on-the-start-of-a-seam-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!