Example usage for org.springframework.context.support ClassPathXmlApplicationContext isSingleton

List of usage examples for org.springframework.context.support ClassPathXmlApplicationContext isSingleton

Introduction

In this page you can find the example usage for org.springframework.context.support ClassPathXmlApplicationContext isSingleton.

Prototype

@Override
    public boolean isSingleton(String name) throws NoSuchBeanDefinitionException 

Source Link

Usage

From source file:org.springframework.aop.aspectj.autoproxy.AspectJAutoProxyCreatorTests.java

private void doTestTwoAdviceAspectWith(String location) {
    ClassPathXmlApplicationContext bf = newContext(location);

    boolean aspectSingleton = bf.isSingleton("aspect");
    ITestBean adrian1 = (ITestBean) bf.getBean("adrian");
    testPrototype(adrian1, 0);//  w ww  .  j a  v  a 2  s  . com
    ITestBean adrian2 = (ITestBean) bf.getBean("adrian");
    assertNotSame(adrian1, adrian2);
    testPrototype(adrian2, aspectSingleton ? 2 : 0);
}