Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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!
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic