11/*
2- * Copyright 2002-2012 the original author or authors.
2+ * Copyright 2002-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2727import org .apache .commons .logging .Log ;
2828import org .apache .commons .logging .LogFactory ;
2929
30- import org .springframework .beans .BeansException ;
3130import org .springframework .beans .factory .BeanClassLoaderAware ;
3231import org .springframework .beans .factory .BeanDefinitionStoreException ;
3332import org .springframework .beans .factory .BeanFactory ;
8584 * @since 3.0
8685 */
8786public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPostProcessor ,
88- ResourceLoaderAware , BeanClassLoaderAware , EnvironmentAware , Ordered {
87+ Ordered , ResourceLoaderAware , BeanClassLoaderAware , EnvironmentAware {
8988
9089 private static final String IMPORT_AWARE_PROCESSOR_BEAN_NAME =
9190 ConfigurationClassPostProcessor .class .getName () + ".importAwareProcessor" ;
@@ -130,6 +129,10 @@ protected String buildDefaultBeanName(BeanDefinition definition) {
130129 };
131130
132131
132+ public int getOrder () {
133+ return Ordered .HIGHEST_PRECEDENCE ;
134+ }
135+
133136 /**
134137 * Set the {@link SourceExtractor} to use for generated bean definitions
135138 * that correspond to {@link Bean} factory methods.
@@ -368,21 +371,21 @@ public void enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFact
368371 }
369372 }
370373
371- @ Override
372- public int getOrder () {
373- return Ordered .HIGHEST_PRECEDENCE ;
374- }
375374
376-
377- private static class ImportAwareBeanPostProcessor implements PriorityOrdered , BeanFactoryAware , BeanPostProcessor {
375+ private static class ImportAwareBeanPostProcessor implements BeanPostProcessor , PriorityOrdered , BeanFactoryAware {
378376
379377 private BeanFactory beanFactory ;
380378
381- public void setBeanFactory (BeanFactory beanFactory ) throws BeansException {
379+ public int getOrder () {
380+ return Ordered .HIGHEST_PRECEDENCE ;
381+ }
382+
383+ @ Override
384+ public void setBeanFactory (BeanFactory beanFactory ) {
382385 this .beanFactory = beanFactory ;
383386 }
384387
385- public Object postProcessBeforeInitialization (Object bean , String beanName ) throws BeansException {
388+ public Object postProcessBeforeInitialization (Object bean , String beanName ) {
386389 if (bean instanceof ImportAware ) {
387390 ImportRegistry importRegistry = this .beanFactory .getBean (IMPORT_REGISTRY_BEAN_NAME , ImportRegistry .class );
388391 String importingClass = importRegistry .getImportingClassFor (bean .getClass ().getSuperclass ().getName ());
@@ -404,13 +407,9 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
404407 return bean ;
405408 }
406409
407- public Object postProcessAfterInitialization (Object bean , String beanName ) throws BeansException {
410+ public Object postProcessAfterInitialization (Object bean , String beanName ) {
408411 return bean ;
409412 }
410-
411- public int getOrder () {
412- return Ordered .HIGHEST_PRECEDENCE ;
413- }
414413 }
415414
416415}
0 commit comments