This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am developing a web application using JavaServlets. The Servlets are supposed to send some messages over ssl to a server that I have developed, let's call it myServer. myserver listens to ssl sockets in an infinite loop. myServer should start at the same time as my web application starts.
My question is that how can I start myServer?. I am thinking of three ways to start myServer:
1- manually start myServer from command line
2- from the init() method of one my Servlets. Then I need to create a thread just to run myServer.
3- have a separate Servlets just to start myServer.
None of the above solutions seems good to me. Does any body has a better idea?