Example usage for org.springframework.data.gemfire.support GemfireBeanFactoryLocator setBeanFactory

List of usage examples for org.springframework.data.gemfire.support GemfireBeanFactoryLocator setBeanFactory

Introduction

In this page you can find the example usage for org.springframework.data.gemfire.support GemfireBeanFactoryLocator setBeanFactory.

Prototype

@Override
public void setBeanFactory(BeanFactory beanFactory) 

Source Link

Usage

From source file:org.springframework.data.gemfire.support.GemfireBeanFactoryLocator.java

/**
 * Factory method to construct a new, initialized instance of {@link GemfireBeanFactoryLocator} with the given
 * default Spring {@link BeanFactory} and associated Spring bean name.
 *
 * @param beanFactory reference to the {@link BeanFactory} used to resolve Spring bean references.
 * @param associatedBeanName {@link String} contain the name of the Spring bean associated with
 * the Spring {@link BeanFactory}./* w  w w.  j a  v a2s. com*/
 * @return a new, initialized instance of {@link GemfireBeanFactoryLocator} with the given default
 * Spring {@link BeanFactory} and associated Spring bean name.
 * @see org.springframework.beans.factory.BeanFactory
 * @see GemfireBeanFactoryLocator
 * @see #GemfireBeanFactoryLocator()
 * @see #setBeanFactory(BeanFactory)
 * @see #setBeanName(String)
 * @see #afterPropertiesSet()
 */
public static GemfireBeanFactoryLocator newBeanFactoryLocator(BeanFactory beanFactory,
        String associatedBeanName) {

    Assert.isTrue(beanFactory == null || StringUtils.hasText(associatedBeanName),
            "associatedBeanName must be specified when BeanFactory is not null");

    GemfireBeanFactoryLocator beanFactoryLocator = new GemfireBeanFactoryLocator();

    beanFactoryLocator.setBeanFactory(beanFactory);
    beanFactoryLocator.setBeanName(associatedBeanName);
    beanFactoryLocator.afterPropertiesSet();

    return beanFactoryLocator;
}