Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

seam

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.

like image 799
Diego Dias Avatar asked Jan 22 '23 17:01

Diego Dias


2 Answers

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

@Observer("org.jboss.seam.postInitialization")
like image 91
Bobby Avatar answered Feb 22 '23 23:02

Bobby


You can annotate your class with the @Startup annotation.

like image 25
mtpettyp Avatar answered Feb 23 '23 00:02

mtpettyp