• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

just called the destroy()

 
naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • 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?

Options

Select 2 correct options.

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.

e.All threads created by this servlet are done.
I have answered A and D.but they are saying A and C can anybody help out of this confusion
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say A, C and D. But they ask you to choose only two. I can see why C is a sure shot option as they say that the destroy() has just been called. This means that init() should have definitely run. So c is a sure shot answer.
 
Sandeep Krish
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why did you ignore E? Ideally, Container creates a thread to serve a client request. Those threads need to be killed while/before destroying the servlet. I will answer A,C,D and E.
[ November 27, 2007: Message edited by: Sandeep Krish ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sandeep Krish:
Why did you ignore E? Ideally, Container creates a thread to serve a client request.

But option E says threads that the servlet creates, not the ones the container creates. It is possible that you wrote your servlet to spawn a new Thread object. It is possible that such a thread is still running when the servlet is destroyed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic