Package org.springframework.beans.factory.access

Examples of org.springframework.beans.factory.access.BeanFactoryReference.release()


   * @param target the target bean to release
   */
  protected void doReleaseBean(Object target) {
    BeanFactoryReference ref = this.beanFactoryReferences.remove(target);
    if (ref != null) {
      ref.release();
    }
  }

}
View Full Code Here


   * @param target the target bean to release
   */
  protected void doReleaseBean(Object target) {
    BeanFactoryReference ref = this.beanFactoryReferences.remove(target);
    if (ref != null) {
      ref.release();
    }
  }

}
View Full Code Here

  @After
  public void destroy() {
    BeanFactoryReference ref1;
    try {
      ref1 = locator1.useBeanFactory(INSTANCE_1);
      ref1.release();
      BeanFactoryReference ref2 = locator2.useBeanFactory(INSTANCE_2);
      ref2.release();

    } catch (IllegalArgumentException e) {
      // it's okay
View Full Code Here

    BeanFactoryReference ref1;
    try {
      ref1 = locator1.useBeanFactory(INSTANCE_1);
      ref1.release();
      BeanFactoryReference ref2 = locator2.useBeanFactory(INSTANCE_2);
      ref2.release();

    } catch (IllegalArgumentException e) {
      // it's okay
    }
    locator1.destroy();
View Full Code Here

    // verify aliases
    assertSame(alias1, alias2);
    assertSame(factory1, alias1);

    aliasRef1.release();
    aliasRef2.release();
    reference1.release();
    reference2.release();
  }

  @Test
View Full Code Here

  @Test
  public void testFactoryLocatorContract() throws Exception {
    BeanFactoryReference factory1 = locator1.useBeanFactory(INSTANCE_1);
    assertNotNull(factory1.getFactory());

    factory1.release();
    try {
      factory1.getFactory();
      fail("should have received exception");
    } catch (IllegalArgumentException e) {
      // it's okay
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.