Forums Register Login

destroy() method doubt

+Pie Number of slices to send: Send
Assuming that the Servlet Container has just called the destroy() method of a servlet instance,
which of the following statements are correct?

a)Any resources that this servlet might hold have been released.
b) The servlet container time out has exceeded for this servlet instance.
c) The init() method has been called on this instance.
d) None of the requests can EVER be serviced by this instance.
(Once destroyed(), this instance is out of the scene! It can't be reused. A new instance will be created if needed.)

e) All threads created by this servlet are done.
(The servlet container cannot kill them and has no idea whether they are done or not.)
Ans : c and d

Is option e) incorrect. Will servlet container call destroy() even when all threads on that servlet instance are not done yet.

(The servlet container cannot kill them and has no idea whether they are done or not.)

Servlet Container creates these threads, hence it must have idea when they are done....
Always! Wait. Never. Shut up. Look at this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 674 times.
Similar Threads
clarification needed regarding destroy()'s behaviour
Enthuware Q
jwebplus doubt?
A Mock Question
destroy() doubt
More...

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