• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

Web service and threads

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm developing a project where I have this scenario:
1 - a client sends a message to the web service with a list of IP adresses
2 - the web service starts to probe those IP adresses from time to time (for example, every 3 minutes. And the probes are SNMP (simple network management protocol) )
3 - so, every 3 minutes, the web service sends a response to the client with the information gathered from the probes (this reponse should be another web service call, since the client is a web service too)

to solve this I would like to create a thread with the @webService annotation that receive the list of IP adresses and another thread that is always running to do the probes and then send the response ...
is it possible ???
I'm new to web service ....

thanks !!!
Ranch Hand
Posts: 2198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are your webservice running in some kind of container, like Tomcat, GlassFish or such?
If so, then the container will create threads that handles incoming requests.
Keep in mind the difference between servlet-based and EJB-based endpoints; the first can be executed by any number of threads at the same time while the second is only executed by one single thread at a time.
Best wishes!
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!