| Issue 18: | Instantiate interfaces and abstract classes in Spring container | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Because of aop, methods in them are able to be implemented by intercepts. So that it would be quite useful to instantiate interfaces or abstract classes which some or all methods implemented by AOP in IOC Container. However, interfaces and abstract classes cannot be instantiated directly in Spring due to their abstract personality. The requirement of this enhancement is interfaces or abstract classes are able to be value of "class" element in "bean" configuration of Spring, and for supporting annotation, the instantiation also are detected by component scanner in Spring.
Mar 16, 2010
Project Member
#2
kuisong....@gmail.com
Mar 16, 2010
For component scanning in Spring, because it is hard code in [http://static.springsource.org/spring/docs/3.0.x/javadoc- api/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.html ClassPathBeanDefinitionScanner] that interfaces and abstract classes cannot be instantiated, and also ClassPathBeanDefinitionScanner cannot be replaced directly in "component-scan" due to new operation of ClassPathBeanDefinitionScanner in [http://static.springsource.org/spring/docs/3.0.x/javadoc- api/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.html ComponentScanBeanDefinitionParser]. Therefore, we have to define schema to override default implementation to allow interfaces and abstract classes to pass the filter. For detail please refer to [https://code.google.com/p/polyforms/source/browse/di/src/main/java/org/polyforms/di/s pring/schema/PolyformsComponentScanBeanDefinitionParser.java PolyformsComponentScanBeanDefinitionParser].
Mar 16, 2010
(No comment was entered for this change.)
Status:
Started
Mar 16, 2010
(No comment was entered for this change.)
Labels:
-Dependency-Injection Module-DI
Mar 18, 2010
add a Method Replacer which throws UnsupportedOperationException as a default implementation of abstract methods in interfaces or abstract classes to inform developer adding intercept for these methods
Mar 18, 2010
Implemented with unit test
Status:
Fixed
|