org.constretto.spring
Class ConfigurationAnnotationConfigurer

java.lang.Object
  extended by org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
      extended by org.constretto.spring.ConfigurationAnnotationConfigurer
All Implemented Interfaces:
BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor

public class ConfigurationAnnotationConfigurer
extends InstantiationAwareBeanPostProcessorAdapter

BeanPostProcessor implementation that autowires annotated fields annotated with the @Configuration or @Environment annotations.

Fields are injected right after construction of a bean, before any config methods are invoked. Such a config field does not have to be public.

If a @Configuration element have the required flag set, and no value could be assosiated with the given key a BeanInstantiationException is thrown invalidating the entire context.

Author:
Kaare Nilsen
See Also:
Configuration, Environment

Constructor Summary
ConfigurationAnnotationConfigurer(ConstrettoConfiguration configuration, AssemblyContextResolver assemblyContextResolver)
           
 
Method Summary
 java.lang.Object postProcessAfterInitialization(java.lang.Object bean, java.lang.String beanName)
           
 boolean postProcessAfterInstantiation(java.lang.Object bean, java.lang.String beanName)
           
 
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
determineCandidateConstructors, getEarlyBeanReference, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationAnnotationConfigurer

public ConfigurationAnnotationConfigurer(ConstrettoConfiguration configuration,
                                         AssemblyContextResolver assemblyContextResolver)
Method Detail

postProcessAfterInstantiation

public boolean postProcessAfterInstantiation(java.lang.Object bean,
                                             java.lang.String beanName)
                                      throws BeansException
Specified by:
postProcessAfterInstantiation in interface InstantiationAwareBeanPostProcessor
Overrides:
postProcessAfterInstantiation in class InstantiationAwareBeanPostProcessorAdapter
Throws:
BeansException

postProcessAfterInitialization

public java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
                                                       java.lang.String beanName)
                                                throws BeansException
Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Overrides:
postProcessAfterInitialization in class InstantiationAwareBeanPostProcessorAdapter
Throws:
BeansException


Copyright © 2008-2011. All Rights Reserved.