Example usage for org.springframework.context ApplicationContext isPrototype

List of usage examples for org.springframework.context ApplicationContext isPrototype

Introduction

In this page you can find the example usage for org.springframework.context ApplicationContext isPrototype.

Prototype

boolean isPrototype(String name) throws NoSuchBeanDefinitionException;

Source Link

Document

Is this bean a prototype?

Usage

From source file:kzht.gm.springframework.extension.context.PrototypeBeanInitializeListener.java

private void initializeAspectJWorld(ApplicationContext ctx) {
    if (ctx == null) {
        return;/*w w  w  . ja  v a2  s.  c  o  m*/
    }

    if (LazyBeanDocumentReader.loadLazyInitAttr()) {
        return;
    }

    for (String name : ctx.getBeanDefinitionNames()) {
        if (ctx.isPrototype(name)) {
            try {
                // AspectJExpression ??? AspectJ ????
                ctx.getBean(name);
            } catch (BeansException e) {
                // ApplicationContext ????????????????
                // Prototype() ? Prototype() ??????????
                // ? ApplicationContext ??????????????????
                // ??????????
            }
        }
    }
}