Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.XmlBeanFactory.destroySingletons()


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


                        "./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

      assertNotNull(instance);
      instance = server.getObjectInstance(ObjectNameManager.getInstance("spring:mbean3=true"));
      assertNotNull(instance);
    }
    finally {
      bf.destroySingletons();
    }
  }

  public void testAutodetectWithExclude() throws Exception {
    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectMBeans.xml", getClass()));
View Full Code Here

      }
      catch (InstanceNotFoundException expected) {
      }
    }
    finally {
      bf.destroySingletons();
    }
  }

  public void testAutodetectLazyMBeans() throws Exception {
    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectLazyMBeans.xml", getClass()));
View Full Code Here

      assertNotNull(server.getObjectInstance(oname));
      name = (String) server.getAttribute(oname, "Name");
      assertEquals("Invalid name returned", "Juergen Hoeller", name);
    }
    finally {
      bf.destroySingletons();
    }
  }

  public void testAutodetectNoMBeans() throws Exception {
    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectNoMBeans.xml", getClass()));
View Full Code Here

    XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectNoMBeans.xml", getClass()));
    try {
      bf.getBean("exporter");
    }
    finally {
      bf.destroySingletons();
    }
  }

  public void testWithMBeanExporterListeners() throws Exception {
    MockMBeanExporterListener listener1 = new MockMBeanExporterListener();
View Full Code Here

        SpringProducer producer = (SpringProducer) factory.getBean("producer");
        assertTrue("Found a valid producer", producer != null);

        producer.start();
        producer.stop();
        factory.destroySingletons();
    }


}
View Full Code Here

        SpringProducer producer = (SpringProducer) factory.getBean("producer");
        assertTrue("Found a valid producer", producer != null);

        producer.start();
        producer.stop();
        factory.destroySingletons();
    }


}
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.