aspose file tools
The moose likes Web Services and the fly likes Web Service question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Web Service question" Watch "Web Service question" New topic
Author

Web Service question

victor thor
Greenhorn

Joined: Apr 13, 2009
Posts: 3
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
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2194
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Service question
 
Similar Threads
Any problem with using two instances of Executor service one after the other?
ExecutorService
java.util.concurrent Package
Design decisions around using ExecutorService
Intimate after thread completes