| Author |
Create an instance of Abstract Class through Spring
|
Gaurav Ram
Ranch Hand
Joined: Feb 23, 2008
Posts: 32
|
|
Hi, As per the java rule we cannot Instantiated Abstract class, thats 100% right. But my confusion arise when i saw the strange behavior in Spring, that, i have created one Abstract class and in that i have created on lookup method and thats also abstract.Then in my Spring config file i have written the below code: and i run my container and this bean initialized successfully, but when i remove the code <lookup-method name="getLatestObjectOfBean" bean="beanToGetFromLookupMethod"/> from above bean defination then it starts giving error which is right that it should not create an instance of Abstract Bean. Can you please explain the reason for this.?
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
The lookup method injection is described here. Do you still have any doubt after reading it ?
|
[My Blog]
All roads lead to JavaRanch
|
 |
 |
|
|
subject: Create an instance of Abstract Class through Spring
|
|
|