Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to starts threads when servere starts up

 
varaprasad mutyala
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

In my application i am using threads that process some commands,

these threads need to be run always, so

i need to start these threads when server starts up.

any help greatly appriciated
 
Benjamin Hiner
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have a servlet context listener. This would run anytime the server is started or reloaded (hot deployed) as long as it was in the web.xml.

Here is an example of how to set it up in the web.xml.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic