Examples of destroySingletons()


Examples of org.springframework.beans.factory.config.ConfigurableBeanFactory.destroySingletons()

              logger.debug("Registered singleton: {}", singleton);
              factory.destroyScopedBean(singleton);
            }
          } catch (RuntimeException e) {
          }
          factory.destroySingletons();
          applicationContext.close();
        }
      } catch (Throwable e) {
        logger.warn("Exception {}", e);
      } finally {
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

       
        DestructiveBean bean = (DestructiveBean) factory.getBean("destructiveBean");
       
        System.out.println("Calling destroySingletons()");
        factory.destroySingletons();
        System.out.println("Called destroySingletons()");
    }
}
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

                        "./ch5/src/conf/lifecycle/disposeInterface.xml"));

        DestructiveBeanWithInterface bean = (DestructiveBeanWithInterface) factory.getBean("destructiveBean");

        System.out.println("Calling destroySingletons()");
        factory.destroySingletons();
        System.out.println("Called destroySingletons()");

    }

}
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

        finishRefresh();
      }

      catch (BeansException ex) {
        // Destroy already created singletons to avoid dangling resources.
        beanFactory.destroySingletons();

        // Reset 'active' flag.
        cancelRefresh(ex);

        // Propagate exception to caller.
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

        }
        catch (BeansException ex) {
          // Destroy already created singletons to avoid dangling
          // resources.
          beanFactory.destroySingletons();
          cancelRefresh(ex);
          // propagate exception to the caller
          throw ex;
        }
      }
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

        finishRefresh();
      }

      catch (BeansException ex) {
        // Destroy already created singletons to avoid dangling resources.
        beanFactory.destroySingletons();

        // Reset 'active' flag.
        cancelRefresh(ex);

        // Propagate exception to caller.
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

        finishRefresh();
      }

      catch (BeansException ex) {
        // Destroy already created singletons to avoid dangling resources.
        beanFactory.destroySingletons();

        // Reset 'active' flag.
        cancelRefresh(ex);

        // Propagate exception to caller.
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

    ConfigurableListableBeanFactory oldBeanFactory = null;
    synchronized (this.beanFactoryMonitor) {
      oldBeanFactory = this.beanFactory;
    }
    if (oldBeanFactory != null) {
      oldBeanFactory.destroySingletons();
      synchronized (this.beanFactoryMonitor) {
        this.beanFactory = null;
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.destroySingletons()

        finishRefresh();
      }

      catch (BeansException ex) {
        // Destroy already created singletons to avoid dangling resources.
        beanFactory.destroySingletons();

        // Reset 'active' flag.
        cancelRefresh(ex);

        // Propagate exception to caller.
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons()

    assertEquals("Juergen", fm.getTestBean().getName());

    FactoryMethods fm2 = (FactoryMethods) xbf.getBean("full");
    assertSame(fm, fm2);

    xbf.destroySingletons();
    assertTrue(tb.wasDestroyed());
  }

  public void testFactoryMethodsWithNullInstance() {
    DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.