Spring Data Commons

org.springframework.data.mapping.context
Class MappingContextAwareBeanPostProcessor

java.lang.Object
  extended by org.springframework.data.mapping.context.MappingContextAwareBeanPostProcessor
All Implemented Interfaces:
BeanPostProcessor, ApplicationContextAware

public class MappingContextAwareBeanPostProcessor
extends Object
implements BeanPostProcessor, ApplicationContextAware

BeanPostProcessor to make Spring beans aware of the current MappingContext. If a MappingContext exists with the default bean name ("mappingContext"), then that bean is used. If there is no MappingContext registered under the default bean name, then the first MappingContext it finds is the one it chooses.

Author:
Jon Brisbin

Constructor Summary
MappingContextAwareBeanPostProcessor()
           
MappingContextAwareBeanPostProcessor(MappingContext<?,?> mappingContext)
           
 
Method Summary
 String getMappingContextBeanName()
           
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setMappingContextBeanName(String mappingContextBeanName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingContextAwareBeanPostProcessor

public MappingContextAwareBeanPostProcessor()

MappingContextAwareBeanPostProcessor

public MappingContextAwareBeanPostProcessor(MappingContext<?,?> mappingContext)
Method Detail

getMappingContextBeanName

public String getMappingContextBeanName()

setMappingContextBeanName

public void setMappingContextBeanName(String mappingContextBeanName)

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws BeansException
Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Throws:
BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Throws:
BeansException

Spring Data Commons

Copyright © 2011. All Rights Reserved.