This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running a Socket server process in Tomcat

 
Chandru Ganesan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a Socket server process and a SOAP service process using Apache-Axis. They are 2 different threads sharing a hashtable. The socket server updates the hashtable and the SOAP service reads from the hashtable. Both process should be run under Tomcat web container.

My questions is, how do I start the socket server background process under Tomcat? The socket server is a plain Java class (NOT a Servlet).

Thanks for yore ideas.

Chandru
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could start the thread with a javax.servlet.ServletContextListener (which gets called when the web application is deployed and when it's shut down).
 
Chandru Ganesan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse

Thanks for your input

Chandru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic