Forums Register Login

Web Service question

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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!
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 817 times.
Similar Threads
java.util.concurrent Package
ExecutorService
Any problem with using two instances of Executor service one after the other?
Design decisions around using ExecutorService
Intimate after thread completes
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:22:30.