• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Web Service question

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a WebService in which a method is used to create an ExecutorService object for managing some threads. I want to have another method that will allow to shutdown the ExecutorService object. Do I have to create a stateful web service? Or is there another possible solution?

Thanks
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
No, as far as I understand, you do not have to create a stateful service. My suggestion is:
- When the operation that is to create the executor service is called, then check if an executor service already exists. If one exists, then exit without doing anything, otherwise create an executor service.
- When the operation that is to shut down the executor service is called, then if an executor service exists, then shut it down, otherwise do nothing.
Best wishes!
reply
    Bookmark Topic Watch Topic
  • New Topic