Example usage for org.springframework.beans.factory.config BeanDefinition SCOPE_PROTOTYPE

List of usage examples for org.springframework.beans.factory.config BeanDefinition SCOPE_PROTOTYPE

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config BeanDefinition SCOPE_PROTOTYPE.

Prototype

String SCOPE_PROTOTYPE

To view the source code for org.springframework.beans.factory.config BeanDefinition SCOPE_PROTOTYPE.

Click Source Link

Document

Scope identifier for the standard prototype scope: "prototype".

Usage

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Sine createSine() {
    return new Sine();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public BulletedList createBulletedList() {
    return new BulletedList();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public ComponentNode createComponentNode() {
    return new ComponentNode();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Document createDocument() {
    return new Document();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public ImageNode createImageNode() {
    return new ImageNode();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public List.Item createTextListItem() {
    return new List.Item();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public NumberedList createNumberedList() {
    return new NumberedList();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Paragraph createParagraph() {
    return new Paragraph();
}

From source file:io.github.moosbusch.lumpi.beans.spi.AbstractPivotBeanConfiguration.java

@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Span createSpan() {
    return new Span();
}

From source file:org.iff.infra.util.spring.script.ScriptFactoryPostProcessor.java

/**
 * Prepare the script beans in the internal BeanFactory that this
 * post-processor uses. Each original bean definition will be split
 * into a ScriptFactory definition and a scripted object definition.
 * @param bd the original bean definition in the main BeanFactory
 * @param scriptFactoryBeanName the name of the internal ScriptFactory bean
 * @param scriptedObjectBeanName the name of the internal scripted object bean
 *///from www  .j av a2 s  . c o  m
protected void prepareScriptBeans(BeanDefinition bd, String scriptFactoryBeanName,
        String scriptedObjectBeanName) {

    // Avoid recreation of the script bean definition in case of a prototype.
    synchronized (this.scriptBeanFactory) {
        if (!this.scriptBeanFactory.containsBeanDefinition(scriptedObjectBeanName)) {

            this.scriptBeanFactory.registerBeanDefinition(scriptFactoryBeanName,
                    createScriptFactoryBeanDefinition(bd));
            ScriptFactory scriptFactory = this.scriptBeanFactory.getBean(scriptFactoryBeanName,
                    ScriptFactory.class);
            ScriptSource scriptSource = getScriptSource(scriptFactoryBeanName,
                    scriptFactory.getScriptSourceLocator());
            Class<?>[] interfaces = scriptFactory.getScriptInterfaces();

            Class<?>[] scriptedInterfaces = interfaces;
            if (scriptFactory.requiresConfigInterface() && !bd.getPropertyValues().isEmpty()) {
                Class<?> configInterface = createConfigInterface(bd, interfaces);
                scriptedInterfaces = ObjectUtils.addObjectToArray(interfaces, configInterface);
            }

            BeanDefinition objectBd = createScriptedObjectBeanDefinition(bd, scriptFactoryBeanName,
                    scriptSource, scriptedInterfaces);
            long refreshCheckDelay = resolveRefreshCheckDelay(bd);
            if (refreshCheckDelay >= 0) {
                objectBd.setScope(BeanDefinition.SCOPE_PROTOTYPE);
            }

            this.scriptBeanFactory.registerBeanDefinition(scriptedObjectBeanName, objectBd);
        }
    }
}