This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Web service and threads  RSS feed

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!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!