Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create an instance of Abstract Class through Spring

 
Gaurav Ram
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The lookup method injection is described here. Do you still have any doubt after reading it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic