• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use of ApplicationContextAware

 
Greenhorn
Posts: 7
Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We know that if parent bean is in singleton scope , then the child bean also is in singleton, even if you set the child bean scope as prototype in configuration xml. Now we implement ApplicationContextAware in parent bean and try to get the child bean object using the ApplicationContext object injected by spring container in the setApplicationContext(ApplicationContext appContext) overriden method.


Question 1: Do we get a new object of the child bean or the same singleton chile bean object created by container while loading the parent bean ?


Question 2: If we do not get a new object of the child bean, is there any way to make the child bean behave like propotype so that we get a new object every time for a new request/get bean call ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic