• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
  • Frits Walraven
  • fred rosenberger
  • salvin francis

destroy() method doubt

Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic