title: What happens to Spring bean after ApplicationContext is shutdown
body: <p>Suppose I have a normal application in which I am creating a Spring application context using <code>ApplicationContext applicationContext = new FileSystemXmlApplicationContext(&quot;bean.xml&quot;);</code></p>
  <p>Now, suppose in this bean.xml  there is bean definition for a Spring bean <code>Bean1</code>, so when I will create the application context then Spring container will instantiate and initialize an object for this <code>Bean1</code>.</p>
  <p>And then I have a non-Spring object holding a reference to the object of this Spring bean <code>Bean1</code>.</p>
  <p>Now, lets say I shutdown the application context using <code>((ConfigurableApplicationContext)appCtx).close();</code>.</p>
  <p>Now my questions are:</p>
  <ol>
  <li>What will happen to the object this Spring bean <code>Bean1</code>, will it be garbage collected as soon as Spring's ApplicationContext is shutdown?</li>
  <li>Since I am holding a reference to the object of this Spring bean <code>Bean1</code>, will I still have this object or will object reference variable pointing to this will become NULL?</li>
  </ol>