Example usage for org.springframework.beans.factory.config ConfigurableListableBeanFactory createBean

List of usage examples for org.springframework.beans.factory.config ConfigurableListableBeanFactory createBean

Introduction

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

Prototype

<T> T createBean(Class<T> beanClass) throws BeansException;

Source Link

Document

Fully create a new bean instance of the given class.

Usage

From source file:org.archive.spring.PathSharingContext.java

/**
 * Initialize the LifecycleProcessor./*from   www. j  av a2 s .  c o m*/
 * Uses HeritrixLifecycleProcessor, which prevents an automatic lifecycle
 * start(), if none defined in the context.
 * @see org.springframework.context.support.DefaultLifecycleProcessor
 */
protected void initLifecycleProcessor() {
    ConfigurableListableBeanFactory beanFactory = getBeanFactory();
    if (!beanFactory.containsLocalBean(LIFECYCLE_PROCESSOR_BEAN_NAME)) {
        HeritrixLifecycleProcessor obj = (HeritrixLifecycleProcessor) beanFactory
                .createBean(HeritrixLifecycleProcessor.class);
        beanFactory.registerSingleton(LIFECYCLE_PROCESSOR_BEAN_NAME, obj);
    }
    super.initLifecycleProcessor();
}