This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

when will spring container manage objects?  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what makes spring container maintain lifecycle and resources of an object? Is it only when the object is instantiated using spring config files? If I extend a spring class, for example, I extend LDAPContextSource and instantiate an object of the extended class in my java module (and not via spring config files) will this object be maintained by spring? I am mainly asking if spring will still manage the resources and connection pooling for this context source.
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

or example, I extend LDAPContextSource and instantiate an object of the extended class in my java module (and not via spring config files) will this object be maintained by spring?


No. If you instantiate it yourself, how Spring is going to know about it ?
 
nilesh shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christopher for the response. I was leaning towards the same answer but I just wanted to make sure that spring is not magically tracking all spring related objects.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!