1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2013 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
27
27
import org .apache .commons .logging .Log ;
28
28
import org .apache .commons .logging .LogFactory ;
29
29
30
- import org .springframework .beans .BeansException ;
31
30
import org .springframework .beans .factory .BeanClassLoaderAware ;
32
31
import org .springframework .beans .factory .BeanDefinitionStoreException ;
33
32
import org .springframework .beans .factory .BeanFactory ;
85
84
* @since 3.0
86
85
*/
87
86
public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPostProcessor ,
88
- ResourceLoaderAware , BeanClassLoaderAware , EnvironmentAware , Ordered {
87
+ Ordered , ResourceLoaderAware , BeanClassLoaderAware , EnvironmentAware {
89
88
90
89
private static final String IMPORT_AWARE_PROCESSOR_BEAN_NAME =
91
90
ConfigurationClassPostProcessor .class .getName () + ".importAwareProcessor" ;
@@ -130,6 +129,10 @@ protected String buildDefaultBeanName(BeanDefinition definition) {
130
129
};
131
130
132
131
132
+ public int getOrder () {
133
+ return Ordered .HIGHEST_PRECEDENCE ;
134
+ }
135
+
133
136
/**
134
137
* Set the {@link SourceExtractor} to use for generated bean definitions
135
138
* that correspond to {@link Bean} factory methods.
@@ -368,21 +371,21 @@ public void enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFact
368
371
}
369
372
}
370
373
371
- @ Override
372
- public int getOrder () {
373
- return Ordered .HIGHEST_PRECEDENCE ;
374
- }
375
374
376
-
377
- private static class ImportAwareBeanPostProcessor implements PriorityOrdered , BeanFactoryAware , BeanPostProcessor {
375
+ private static class ImportAwareBeanPostProcessor implements BeanPostProcessor , PriorityOrdered , BeanFactoryAware {
378
376
379
377
private BeanFactory beanFactory ;
380
378
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 ) {
382
385
this .beanFactory = beanFactory ;
383
386
}
384
387
385
- public Object postProcessBeforeInitialization (Object bean , String beanName ) throws BeansException {
388
+ public Object postProcessBeforeInitialization (Object bean , String beanName ) {
386
389
if (bean instanceof ImportAware ) {
387
390
ImportRegistry importRegistry = this .beanFactory .getBean (IMPORT_REGISTRY_BEAN_NAME , ImportRegistry .class );
388
391
String importingClass = importRegistry .getImportingClassFor (bean .getClass ().getSuperclass ().getName ());
@@ -404,13 +407,9 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
404
407
return bean ;
405
408
}
406
409
407
- public Object postProcessAfterInitialization (Object bean , String beanName ) throws BeansException {
410
+ public Object postProcessAfterInitialization (Object bean , String beanName ) {
408
411
return bean ;
409
412
}
410
-
411
- public int getOrder () {
412
- return Ordered .HIGHEST_PRECEDENCE ;
413
- }
414
413
}
415
414
416
415
}
0 commit comments