info.magnolia.module.blossom.support
Class BeanFactoryUtils

java.lang.Object
  extended by info.magnolia.module.blossom.support.BeanFactoryUtils

public class BeanFactoryUtils
extends Object

Utility methods for BeanFactory.

Since:
1.2

Constructor Summary
BeanFactoryUtils()
           
 
Method Summary
static void applyBeanPostProcessorsBeforeDestruction(Object bean, String beanName, org.springframework.beans.factory.support.AbstractBeanFactory beanFactory)
          Applies destruction aware post processors on the supplied bean.
static void destroyBean(Object bean, String beanName, org.springframework.beans.factory.support.AbstractBeanFactory beanFactory)
          Destroys a bean by applying destruction aware post processors and invoking destroy methods.
static void disposeBean(Object bean, String beanName)
          Invokes destroy method on the bean if it implements DisposableBean.
static void registerBeanIfMissing(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, Class<?> beanClass)
          Registers a bean definition for the specified class if no bean definition already exists for the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanFactoryUtils

public BeanFactoryUtils()
Method Detail

destroyBean

public static void destroyBean(Object bean,
                               String beanName,
                               org.springframework.beans.factory.support.AbstractBeanFactory beanFactory)
Destroys a bean by applying destruction aware post processors and invoking destroy methods.


disposeBean

public static void disposeBean(Object bean,
                               String beanName)
Invokes destroy method on the bean if it implements DisposableBean.


applyBeanPostProcessorsBeforeDestruction

public static void applyBeanPostProcessorsBeforeDestruction(Object bean,
                                                            String beanName,
                                                            org.springframework.beans.factory.support.AbstractBeanFactory beanFactory)
Applies destruction aware post processors on the supplied bean.


registerBeanIfMissing

public static void registerBeanIfMissing(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                         org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
                                         Class<?> beanClass)
Registers a bean definition for the specified class if no bean definition already exists for the class. The bean definition is given a generated name unique within the bean factory.



Copyright © 2009-2012 Magnolia International Ltd.. All Rights Reserved.