Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

destroy() method query  RSS feed

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one query regarding destroy() method. Suppose during init()...i intialized a factory of objects, or say a HashMap with some key-values. Now when server is shutdown, will those objects in HashMap be removed automatically or we have to make everything null in destroy..

Does this mean of release the resources or destroy() only used to release database/streams.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you shut down the server, everyting in memory will be released.
The destroy method is just a place for you to put code that you want executed when the servlet is taken out of service.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!